Hello all together,
today I had kind of a problem using lazy-loading.
I solved this problem with an in my opinion unlucky way - see as following:
$menue = Menue::model()->with(array(
'items' => array(
'order' => 'position ASC',
'condition' => 'language_id = :lang && parent_item_id = :parent_id',
'params' => array(
'lang' => self::get()->language_id,
'parent_id' => $parent_id,
),
),
))->findByAttributes(array(
'domain_id' => CurrentDomain::get()->id,
'identifier' => $identifier,
));
How could I do it better? Is it possible to define “attributes” within “with()”? Tryd that but it didn’t work.
Hoping for an answer
Kind regards, Dominik