parent preload

28 views
Skip to first unread message

aniolekx

unread,
Nov 9, 2012, 2:51:09 PM11/9/12
to redbeanphp
is there a way to preload all parents? (to the top parent)

gabor

unread,
Nov 10, 2012, 7:02:46 AM11/10/12
to redbe...@googlegroups.com


At the moment, no.
But I'm working on it.

If you need a simple list with columns from various tables I recommend to either use a view and then load beans from there, or to query manually.

Cheers,
Gabor

gabor

unread,
Nov 12, 2012, 2:39:05 PM11/12/12
to redbe...@googlegroups.com

By the way,
I overlooked a simple solution that works to some extend:
You can of course manually multiple preload parent beans:

(case: book->page->text)
$texts = R::find('text');
R::preload($texts,array('page'));
$beans = array();
foreach($texts as $t) $beans[] = $t->page;
R::preload($beans,array('book'));

cheers,
Gabor
Reply all
Reply to author
Forward
0 new messages