I've got a zend framework model:
class User extends Zend_Db_Table_Abstract {
protected $_name = 'users';
protected $_primary = 'id';
protected $_dependentTables = array('UserItem');
public function refresh($) {
$items = $this->findDependentRowset('UserItem', 'items');
// do stuff with each item
print_r($items);
die();
}
}
I've also got the related model:
<?php
class UserItem extends Zend_Db_Table_Abstract
{
protected $_name = 'user_items';
protected $_referenceMap = array(
'items' => array(
// user_id is the name of the field on the USER_ITEMS table
'columns' => 'user_id',
'refTableClass' => 'User',
// id is the name of the field on the USERS table
'refColumns' => 'id'
)
);
}
?>
I'd like to me able to call User->refresh();
and have a fancy little stack of things happen. But the error is
Fatal error: Call to undefined method FbUser::findDependentRowset()
Which is telling me that although I think i'm doing it right according to the Zend documentation http://framework.zend.com/manual/en/zend.db.table.relationships.html I'm missing something.
If it makes a difference, at first run the items list will be empty, then I'll "Upsert" a whole bunch of items - future runs I'll compare all items an only update the ones that are different. Hmm... nope that's definitely not relevant :)