Questions tagged [zend-db-table]

Object-oriented interface to database tables

The Zend_Db_Table class is an object-oriented interface to database tables. It provides methods for many common operations on tables. The base class is extensible, so you can add custom logic.

The Zend_Db_Table solution is an implementation of the Table Data Gateway pattern. The solution also includes a class that implements the Row Data Gateway pattern.

Official documentation

437 questions
0
votes
1 answer

Zend Db update and delete method and quoting

In documenation in Since the table update() method proxies to the database adapter update() method, the second argument can be an array of SQL expressions. The expressions are combined as Boolean terms using an AND operator. Note: The values and…
PaulP
  • 1,925
  • 2
  • 20
  • 25
0
votes
2 answers

Saving row after populating from Array - Zend

Once again a Zend Framework question! Any help is appreciated. I have a DB table class which i want to use to insert/update rows when a form is posted, and i would like to use the save() method so it can all go through the same method. //Users Db…
Stuart
  • 3,258
  • 4
  • 29
  • 39
0
votes
1 answer

Zend Authentication where user role stored in separate db table

I have a User table where userID, username and password are stored and a Role table which contains user role . To link these two tables, I have a table (user_role) which contains userID and roleID. How can I use Zend Auth to authenticate users and…
arjang27
  • 241
  • 6
  • 13
0
votes
1 answer

zend : init() not getting called when i am writting __constructor() in my model class

I have written init() function in my db model class and i am using multi db zend functionality. in my init() i am fetching my db adapters and then my default adapter gets set as a default adapter and everything works fine. More than that i am doing…
Jimit Shah
  • 92
  • 1
  • 10
0
votes
1 answer

What is the proper way of implementing Table Data Gateway pattern in Zend Framework 1.x?

According to Zend quick start guide I need three classes (A model, A mapper class and a table gateway class) to implement the Table Data Gateway pattern. But is this a good approach? Right now this is how I implement the pattern. class…
Jay Bhatt
  • 5,601
  • 5
  • 40
  • 62
0
votes
1 answer

Zend Framework create a sql function

I would like to create a sql query in Zend Framework in the Abstract.php or in model? but I have a hard time figure out how to do it. I am new in zend framework. The query that I want to create looks like that: delete from users where id not…
Ya Fa Su
  • 160
  • 1
  • 4
  • 13
0
votes
2 answers

How do I ignore the created column on a Zend_DB table save?

how would I ignore having Zend_DB save() from trying to fill out a created column? I do not need that column for a certain model.
Darren
  • 10,631
  • 8
  • 42
  • 64
0
votes
1 answer

how to write this query using DATE_FORMAT using Zend Framework?

Basically, I want a news page with Archives list in the side column based on the month and year.. for example June 2012. The table is named 'news', with columns news_id, news_title, news_entry, updated, created. Updated and created are timestamps.…
atomheart
  • 51
  • 8
0
votes
1 answer

Zend_Db_Table_Abstract and Default Scope

Is there a way to add a default scope to a Zend_Db_Table_Abstract based model. I want to be able to query a model with some conditions taken as default. e.g. deleted = false order name asc
user138095
0
votes
1 answer

I want to use an if in where clause in zend framework

The following is part of my query where if(teler.arrange ="Y",(teler.id_to IN ('1940')),0) GROUP BYto, How will I have this in a Zend query which is currently like this $objSelect->Orwhere('teler.id IN (?))', $where['id']);
0
votes
2 answers

Zend framework 2 - how do i connect to database and retrieve query results?

I have ZF2 tried following, but it does not give any query results with ZF1 works, ZF2 not workings. Is ZF2 database adapters incomplete, left as bug not resolved by ZF2 itself? Cause documentation tells to do so but it simply not working. Does ZF2…
user285594
0
votes
2 answers

Increment values using Zend_DB_Table Raw SQL

I have a website where a user can upload images for a real estate property. The table structure: image_id property_id userid filename thumbfilename display_order timestamp The scenario: When a user uploads multiple pictures, he / she SHOULD be…
Dennis Day
  • 607
  • 2
  • 5
  • 13
0
votes
1 answer

ZendFramework2 AbstractTableGateway getSql

I got a ZF2 project with 2 Models PosTable/TopTable which extend AbstractTableGateway. I want to Paginate results from those Tables so i have a Pagination function in both of them. this is what the PosTable Model looks like: ... class PosTable…
0
votes
2 answers

Zend Framework DB table fetch array

is it possible to fetch array from db, taking one column as array key and other column as array value? My current code: $table = new Zend_Db_Table('translations'); $where = $table->getAdapter()->quoteInto('lang = ?', $locale); $result =…
Bounce
  • 2,066
  • 6
  • 34
  • 65
0
votes
1 answer

Zend Framework Class 'Table' not found error

I have basic zend framework installation. I create new db table models/tables/User.php
Bounce
  • 2,066
  • 6
  • 34
  • 65