If I switch the Zend library to a previous version to 13530, this code works.
After that It throws the "Table already set" exception when the following code dispatch findDependentRowset method.
The rules are well defined, if not they won't work on previous revision.
protected $_dependentTables = array('Car_Faqs');
The code:
// This code was inside a Table Model Class
$category = $this->find(intval($categoryId));
$currentCategory = $category->current();
$faqs = new Car_Faqs();
$select = $faqs->select()->order('createdAt DESC');
$faqsFromCategory = $currentCategory->findDependentRowset('Car_Faqs', null, $select);
Inside Car_Faqs Model the rules are that:
protected $_referenceMap = array(
'FaqCategory' => array(
'columns' => array('category_id'),
'refTableClass' => 'Car_Faqs_Category',
'refColumns' => array('category_id'),
'onDelete' => self::CASCADE,
'onUpdate' => self::RESTRICT
)
);
Guillem
2009/1/16 Jaka Jančar <jaka@kubje.org>
Are you passing the $select parameter to findDependentRowset()? If so, was it created from/with a table different than $dependentTable?
Jaka
On 16. Jan 2009, at 11:33, Guillem Llop wrote:
Hi,
since commit 13530 from Zend_Db_Table_Select updating file Select.php i have a problem with the following message: "Table already set." when I use the findDependentRowset() method.
I have looked in Zend issue tracker but I havent found anything. Have anyone the same problem or know how can i resolve it? Thx.
Guillem Llop.
没有评论:
发表评论