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
2
votes
3 answers

Refactoring a Zend_View_Helper_Action widget, utilizing Zend_Controller_Action_Helper_FlashMessenger, into a model

I've tried to create a login widget that can be included at will in any action that is outside the content of the application that requires login. My thought here was that I wanted a DRY-approach for rendering the login box with any error messages…
PatrikAkerstrand
  • 45,315
  • 11
  • 79
  • 94
2
votes
2 answers

Zend_Db_Table_Abstract and Zend_Db_Expr

I have recently inherited an application, written using ZF, which has various fields encrypted in the db. There are many models extending Zend_Db_Table_Abstract with code similar to this example -
user1191247
  • 10,808
  • 2
  • 22
  • 32
2
votes
2 answers

Zend_Db_Table_Abstract Loading Joined Models

I have a tables named: client (id, alias) post (id, subject) post_client (id, post_id, client_id) Many clients can be joined to a post. Using Zend DB Table abstract I have started to build a model, here are the classes: ORM_Post class ORM_Post…
azz0r
  • 3,283
  • 7
  • 42
  • 85
2
votes
1 answer

Zend_Db_Table: Delete multiple entries

I wanted to delete some db entries and each of them has a unique ID. My current code looks so, taken from here: Zend Framework: How to delete a table row where multiple things are true? $where = array(); foreach ($IDs as $ID) { $where[] =…
Poru
  • 8,254
  • 22
  • 65
  • 89
2
votes
1 answer

Zend Framework: DB / Models: Securing Other Users Rows - Overriding Concrete Methods

I am trying to research the best way to secure users data. Example: An application has a table 'widgets', each user can have as many 'widgets' as required. The application identifies the 'widgets' by the 'userId' column, which referenced the ID of…
Jucks
  • 400
  • 4
  • 10
2
votes
4 answers

Zend_Db_Table_Abstract count

On Zend_Db_Table_Abstract I'm using this code to get the count of results for my select: $this->setTableName('visitors'); $select = $this->select() ->from('visitors') ->columns(array('total' => new…
Owen
  • 7,347
  • 12
  • 54
  • 73
2
votes
1 answer

zend framework: how to create trigger "before/after" insert/update

I am looking for a method that will be called before/after insert() or update() in Zend_DB? I am don't want to relly on database trigger for this ... could you help me ? thank you !!!
nightingale2k1
  • 10,095
  • 15
  • 70
  • 96
2
votes
1 answer

How to write Unit Test case for Zend Db Table Row

I am trying to write test case for my Row classes and I don't really what is the proper way to do that. I've seen many example use model & table, for example http://techportal.inviqa.com/2010/12/07/unit-testing-databases-with-zend-framework/. The…
rainmore
  • 30
  • 1
  • 4
2
votes
2 answers

Multiple Tables in Zend based on the Quick Start Guide Example

I am new to Zend and have been attempting to follow the Zend Quick Start Guide's example of using Data Mappers and extending Zend_Db_Table_Abstract. I think I've grasped the general concepts, but I am now wondering, how I would go about modifying…
Dan
  • 1,559
  • 1
  • 15
  • 18
2
votes
1 answer

Multiple level dependency models in Zend Framework

I'm developing an application in Zend Framework to handle the rentals for a commercial property rental company. The company has multiple buildings which each have multiple floors, which each have multiple units. The models I've setup just extend…
2
votes
1 answer

stuck with zend_db_table + join

trying to understand of using Zend_Db_Table. i have a such table: then i created classes: class table_1 extends Zend_Db_Table_Abstract { protected $_name = 'table_1'; protected $_primary = 't1_id'; protected $_referenceMap = array( …
Subdigger
  • 2,166
  • 3
  • 20
  • 42
2
votes
1 answer

Zend Framework Update Checkboxes in Database

I have just started with Zend Framework, so might be a bit of a silly question coming up. I have a Form with 5 Checkboxes. A User can click on as many checkboxes as needed. This gets entered into the Database. (1:n) This all works fine. But now I am…
Luka
  • 748
  • 2
  • 9
  • 36
2
votes
1 answer

Zend_Db_Adapter_Abstract::update() must be an array

I am having some trouble updating a row. My class is extending Zend_Db_Table_Abstract Here is my code: return $this->update( array('data' => $data), $this->getAdapter()->quoteInto("id = ?", $id) ) ? true :…
cloudstrife
  • 105
  • 1
  • 1
  • 7
2
votes
1 answer

Complex reference maps in Zend_Db_Table to account for multi-column keys

I am going to attempt to keep this as simple as possible, but the use case is outside the original intention of Zend_Db I fear. It concerns a set of tables I have for tagging pages (or anything else eg. documents) in a CMS. I have three…
Treffynnon
  • 21,365
  • 6
  • 65
  • 98
2
votes
1 answer

Zend Db Table Abstract add new field to the row

I once posted this question, but had no answer at all, this time, the question is best formated so It will be more easy to understand what I need. I created a Model with Zend_Db_Table_Abstract Add the primaryKey and the table name, all ok. Then, I…
digoferra
  • 1,001
  • 3
  • 17
  • 33