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
9
votes
4 answers

Learning Zend Framework after Magento: Models

I have been working over an year with Magento and have learned it good enough. Now I want to learn Zend, and I'm stuck with models. I'm used to have entities and collection of entities in Magento, and it's likely that I'll want to use Zend_Db_Table,…
s3v3n
  • 8,203
  • 5
  • 42
  • 56
9
votes
1 answer

Using Zend Framework Db Tables without MVC

I am trying to use the Zend Framework without using the MVC structure, specifically the Db_Table classes. I have created a couple of classes representing my database tables, i.e. class DBTables_Templates extends Zend_Db_Table_Abstract { …
Stuart
  • 3,258
  • 4
  • 29
  • 39
7
votes
3 answers

Zend Enable SQL Query logging

I am using this to retrieve the database connection atm. $db = Zend_Db_Table::getDefaultAdapter(); I do set this up in my config like this: resources.db.adapter = pdo_mysql resources.db.isDefaultTableAdapter = true resources.db.params.host =…
Oldek
  • 2,679
  • 5
  • 23
  • 25
7
votes
2 answers

Translating a query to use Zend_Db_Select

I'm having some problems translating this query to use ZF's Zend_Db_Select: SELECT b.id, b.title, b.description FROM memberships AS m JOIN blogs AS b ON b.id = m.blog_id WHERE m.user_id = ? ORDER BY m.created LIMIT 0, 30 (this query works and…
Ross
  • 46,186
  • 39
  • 120
  • 173
7
votes
2 answers

zend-framework output Zend_Db_Table's select() statement generated query

i want to output the query generated by Zend_Db_Table's select() statement for testing porposes but i dont know how.
rahim asgari
  • 12,197
  • 10
  • 43
  • 53
6
votes
3 answers

How to quote column names with Zend_Db?

I am using key as a column name in a MySQL table. Since this is reserved, it needs to be escaped properly to be used in a query: … WHERE `key` = 'test' Manually this is no problem, but I am using the Zend Framework and want to have it handle the…
favo
  • 5,426
  • 9
  • 42
  • 61
6
votes
2 answers

"IS NULL" in Zend_Db_Table select not working

I'm trying to do a join on 2 tables in Zend, using the DbTable / model / mapper structure. If, in my mapper, I do this: $select = $this->getDbTable()->select(Zend_Db_Table::SELECT_WITH_FROM_PART) ->setIntegrityCheck(false) …
Peter
  • 1,211
  • 4
  • 17
  • 32
5
votes
1 answer

Delete a row from Zend_Db_Table using JOIN

I need to delete a record using Zend_Db_Table referencing the rence table. In SQL the query would look like this: DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL; Is there a way to do this more elegant than the code below? $table…
Minras
  • 4,136
  • 4
  • 18
  • 18
5
votes
2 answers

Get Loaded Config In Controller

How do i get the already loaded options in the controller file in a zend framework installation without creating a new Zend_Config([ ** ]); instance.
Brandon_R
  • 121
  • 2
  • 6
5
votes
1 answer

Zend_Db subquery

I've been trying to construct a sql query with ZendFW, but I cant seem to get it to function like I want to (or function at all). This is the query that works that I'm trying to build with zend_db select() SELECT tc.trip_title, td.ID, td.trip_id, …
user387302
  • 395
  • 1
  • 4
  • 13
5
votes
2 answers

Best way to do an Inner Join using the Zend Framework?

It seems like there's a few different ways to join two tables using the Zend Framework, but I've never done it before so I don't know which is the best way to do it. This is what I'm trying to do... I have 3 tables in my database: users ( id ,…
Andrew
  • 227,796
  • 193
  • 515
  • 708
5
votes
4 answers

Zend_Db_Table subquery

I have a some SQL that I want to use with ZendFW, but I can't get it working and it's driving me crazy. I get the correct result with this query: SELECT DISTINCT e.festival_id FROM entries AS e, mail_log as m WHERE e.status = 1 AND e.festival_id…
Henryk
  • 61
  • 1
  • 5
5
votes
2 answers

Zend: Two Objects, one Row

I've recently started using Zend Framework (1.8.4), to provide admin tools for viewing the orders of a shopping cart site. What I'd like to do is to efficiently create multiple model (Zend_Db_Table_Row_Abstract) objects from a single database result…
Matt Hucke
  • 673
  • 1
  • 6
  • 12
5
votes
1 answer

How Zend DB Manage Database Connections

I am using Zend Framework for my PHP developments and here is a small function I used to execute a query. This is not about an error. The code and everything works fine. But I want to know some concept behind this. /** * Get dataset by…
Prasad Rajapaksha
  • 6,118
  • 10
  • 36
  • 52
5
votes
2 answers

OR clause in Zend DB update?

I'd like to do a Zend db update with an OR clause. What would be the equivalent statement to: UPDATE mail SET message_read = 1 WHERE id = 5 OR id = 10
joeschmidt45
  • 1,932
  • 2
  • 17
  • 20
1
2
3
29 30