I'm sorry ... I'll try to explain it a bit better.

Let's say we have table NEWS with fields  id, title, content, rel_author_id,
rel_category_id.

So fetching all news would look something like this:

<?php
$news =  new News();
$newsRowset = $news->fetchAll();
?>

Now every news has author, who's name I wanna output too. Solution would be
to call method "findParentRow('Users')" inside of template's foreach (for
every row - news) or to go thru all rows in controller code and get it
there.

What I was thinking is there something to tell what parents (plural is used
cuz news has parent of rel_author_id and rel_category_id) should be fetched. 
For example (I know it's not existing) something like:
<?php
$news = News()
$news->autoFetchParents = array('Users', 'Categories');
$newsRowset = $news->fetchAll();
?>
I guess there would be a problem when you'd have some relation inside user
table and you would also need that data at outputing news.
Maybe that would could be solved with MD array .:)
array('Users' => array('Roles'), 'Categories');
and more complex:
array('Users' => array('Roles' => array('subsubRole')), 'Categories');

Sorry ... late hour :)
-- 
View this message in context: 
http://www.nabble.com/Zend_Db-%28Table-Row%29-tf4179879s16154.html#a11900923
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to