How to use related() multiple times?
- netteman
- Member | 125
Hi
I know how to use
$this->database->table('book')->related(...)
https://doc.nette.org/…ase/explorer#… in this database https://ctrlv.cz/…/22/iBkw.png to get to the table book_tag and then to the table tag.
Is it possible to get even to tag_translation and keep the low number of queries generated by nette?
{foreach $books as $book}
{$book->title}<br />
{foreach $book->related('book_tag') as $book_tag}
{$book_tag->tag->name}
{foreach}
code to echo translations of a tag
{/foreach}
{/foreach}
{/foreach}