Re: How can i force a specific bean as method argument?

18 views
Skip to first unread message

gabor

unread,
May 7, 2013, 2:33:15 PM5/7/13
to redbe...@googlegroups.com

Hi,

You can box a bean:

public function myMethod(Model_Book $book) { ... }

now pass a boxed bean:

$book = R::load('book', $id);
$object->myMethod($book->box);

cheers,
Gabor



On Tuesday, May 7, 2013 12:24:23 PM UTC+2, Alberto Ruffo wrote:
Hello everybody, while in other ORM i can use this:

public function getProduct( Product $p) { ... }

How can i force a given bean as a method parameter?
Should i create a model, pass it and then call unbox() method? 

Thank you very much.

Alberto

Alberto Ruffo

unread,
May 10, 2013, 7:53:02 PM5/10/13
to redbe...@googlegroups.com
Thanks
Reply all
Reply to author
Forward
0 new messages