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
1
vote
2 answers

zend framework update from another table

I got model in Zend Framework what extends Zend_Db_Table where $this->_name = 'tableA'. It is very nice how long I doing insert(), update(), or delete(). How I can realize updating main table based on value from another table.. ? In raw SQL query it…
bensiu
  • 24,660
  • 56
  • 77
  • 117
1
vote
2 answers

Applying a SQL function on Zend_Db_Table_Row::save()

Is it possible, when saving a Zend_Db_Table_Row, to make ZF apply a SQL function on one column? For example, if $row->save() generates by default this SQL query: UPDATE table SET field = ? WHERE id = ?; I would like it to automatically apply the…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
1
vote
2 answers

No adapter found for App_Model_DbTable_User

I have very strange error I can't understand. I started a new project throw the zf.sh. And now when I try to ge the data from the database I get error for every table I have created when I'm trying to get data from it. In this case I try to get a…
jarnesjo
  • 138
  • 1
  • 9
1
vote
2 answers

Zend_Db is ignoring my default field values!

I'm using Zend Framework 1.7 with a MySQL 5.0 database for a project I'm doing. Part of the system is a longish form that asks a user for various dates (in dd/mm/yyyy format) as well as some integer fields. In my MySQL table, all these fields have a…
fistameeny
  • 1,048
  • 2
  • 14
  • 27
1
vote
1 answer

How to convert given multiple join query to ZendFrame work query

SELECT `blg`.`id` , `blg`.`heading` , `blg`.`description` , `cat`.`name` AS `categoryname` , `mem`.`firstname` AS `user` , ( SELECT COUNT( * ) FROM blog_comments WHERE blog_comments.status = '1' AND blog_comments.blogid = blg.id) AS…
Jothis
  • 11
  • 1
1
vote
1 answer

How to use schema for multiple sqlite db for Zend_Db_Table

So I have multiple sqlite database. /path/database1.db /path/database2.db When i make a Zend_Db_Table for it, how do I specify which db to use? class Application_Model_DbTable_User extends Zend_Db_Table_Abstract { protected $_schema =…
Lasiaf
  • 13
  • 2
1
vote
1 answer

Order Zend_Db_Table rowset by reference column

i know i can define relationships through _referenceMap, i know that i con join selects trough $db->select() But what i need is to fetch rowset in model extending Zend_Db_Table_Abstract and then order it by value of referenced column from another…
1
vote
1 answer

How do you work with a relational database in Zend Framework?

I'm using the zend framework to write an app and I'm having lots of problems getting my relational database models to work. I've read the quickstart and the docs several times and I'm still not sure how to do this. I post a picture of the…
la_f0ka
  • 1,773
  • 3
  • 23
  • 44
1
vote
1 answer

How can I do a zend_db_table query with the criteria involving a dependent table?

I have a table of events and a _dependentTable of eventPerformers. One event can have multiple performers. The performers are related to the events via eventId key within the eventPerformers table. The events table holds no performer data. Using…
Jeff
  • 19
  • 1
1
vote
3 answers

Get lastest version of a content group SQL

I have content table where I have many contents and various versions of those contents. The columns are content varchar,document_id int (identifies a content between many versions) and version int I want to return the lastest version of each content…
dextervip
  • 4,999
  • 16
  • 65
  • 93
1
vote
1 answer

What is the function similar to mysql_affected_rows() in ZendDb

Following script gives us deleted rows count, /* this should return the correct numbers of deleted records */ mysql_query('DELETE FROM mytable WHERE id < 10'); printf("Records deleted: %d\n", mysql_affected_rows()); Is their any function similar to…
Aadi
  • 6,959
  • 28
  • 100
  • 145
1
vote
3 answers

Increment a column in MySQL

Is there a way in Zend to increment an integer, held in a MySQL column, by 1? Thanks edit: My current code is like: $row = $this->find($imageId)->current(); $row->votes = // THIS IS WHERE I WANT TO SAY INCREMENT $row->save();
edwinNosh
  • 389
  • 3
  • 9
  • 16
1
vote
0 answers

Need Help Joining Multiple tables in Zend framework MySQL INNODB

Im currently working with Zend framework. I'm trying to write a query in MYSQL INNODB database format to return all the provider which match with all the quote criteria values. Here is a database design of my…
user648198
  • 2,004
  • 4
  • 19
  • 26
1
vote
2 answers

Using relations for setting in Zend_Db_Table_Row

is there a way how to use Zend_Db relations for setting related objects? I am looking for something like following code: $contentModel = new Content(); $categoryModel = new Category(); $category =…
Martin Rázus
  • 4,615
  • 5
  • 30
  • 33
1
vote
3 answers

How does one use the RDBMS in a performant way on top of Zend_Db_Table? (if at all...)

There's this constant war going on in my thoughts when I work on a Zend Framework project -- good application design mandates that the number of database queries be minimized. Each query is expensive in terms of both latency and RDBMS calculation…
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552