Say I have
$book = R::dispense( 'book' );
$page = R::dispense( 'page' );
R::store($page);
$book->ownPage[] = $page;
R::store($book);
Given a 'page' bean is it possible find its owning book other than executing some SQL where I look for the book_id property of the page on the book table?
something like:
$page->owningBook();
Currently I use this code:
$owningBook = R::load('book', $page->book_id);
I believe, and I am 90% sure on this, you can just do:
$page->book->_______
I use something similar in my code:
$companys->ownEmployees=array($employee);
Then when I view the employee by itself I use:
$company=$employee->company;
Give it a shot and let me know.
Edit: 100% Thanks!