Explain please how to use WITH() in Kohana ORM -
$contract = orm::factory('contract', 1);
i can shipper this: $contract->shipper;
can owners this: $contract->owners->find_all();
but cant use
$contract->owners , preload them orm::factory('contract', 1)->with("owners");
so why need this, cant understand does, , how works ?
unfortunately ->with()
works has_one
or belongs_to
relationships, not has_many
. way expand many<->many relations ->find_all()
from with
method description:
binds one-to-one object model.
you can check source code with
function here: https://github.com/kohana/orm/blob/3.3/master/classes/kohana/orm.php#l901
Comments
Post a Comment