findDependentRowset returning all rows

carolcerulean

New Member
I have these two models:\[code\]class Application_Model_List extends Zend_Db_Table_Abstract{ protected $_name = 'list'; protected $_primary = 'list_id'; protected $_dependentTables = array('Application_Model_Task'); public function getUserLists($user) { $select = $this->select()->from($this->_name)->where('list_user = ?',$user); return $this->fetchAll($select); }}\[/code\]and \[code\]class Application_Model_Task extends Zend_Db_Table_Abstract{ protected $_name = 'task'; protected $_primary = 'task_id'; protected $_referenceMap = array( 'List' => array( 'columns' => 'task_list_id', 'refTableClass' => 'Application_Model_List', 'refColumns' => 'list_id' ) );}\[/code\]I call \[code\]getUserLists\[/code\] within my controller like this:\[code\]public function indexAction(){ $lists = new Application_Model_List(); $userLists = $lists->getUserLists(1); $this->view->lists = $userLists;}\[/code\]and pass it to my view and then call \[code\]findDependentRowset\[/code\] like this:\[code\]foreach($this->lists as $list){ echo $list->list_title; $tasks = $list->findDependentRowset('Application_Model_Task'); foreach($tasks as $task){ echo $task->task_title; }}\[/code\]but the problem is it outputs all rowsets from the dependent table, not just the ones matching the where clause
 
Back
Top