Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Zend_Db_Table
-
Labels:None
Description
Rowsets currently allow for the following:-
findDependentRowset($dependentTable, $ruleKey = null) findParentRow($parentTable, $ruleKey = null) findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule = null, $matchRefRule = null)
It would be great to extend these method signatures to include custom WHERE, ORDER and LIMIT clauses in much the same way as the parent table fetchAll method so the results can be fine-tuned:-
findDependentRowset($dependentTable, $ruleKey = null, Array $where = array(), $order = null, $limit = null, $offset = null) findParentRow($parentTable, $ruleKey = null, Array $where = array(), $order = null, $limit = null, $offset = null) findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule = null, $matchRefRule = null, Array $matchParams = array())
This would then be applied to each applicable method as follows:
public function findDependentRowset($dependentTable, $ruleKey = null, Array $where = array(), $order = null, $limit = null, $offset = null) { ... return $dependentTable->fetchAll($where, $order, $limit, $offset); } public function findParentRow($parentTable, $ruleKey = null, Array $where = array(), $order = null) { ... return $parentTable->fetchRow($where, $order); }
The many-to-many method is obviously a little more complex as multiple tables are involved, but perhaps an associative array called $matchParams could handle this with a per-table array of where, order, limit and offset:-
$matchParams = array(
'table1' => array(
'where' => array('foo in (1,2,3)', 'bar in (3,4,5)'),
'order' => 'name ASC',
'limit' => 5
),
'table2' => array(
'where' => array('foo in (1,2,3)', 'bar in (3,4,5)'),
'order' => 'name ASC',
'limit' => 5
)
);
Issue Links
| This issue duplicates: | ||||
| ZF-1182 | Support order, count, offset in findDependentRowset() |
|
|
|
I have reported that long time ago. The answer was simple - no.
http://framework.zend.com/issues/browse/ZF-1182