Hello,
Is there a way to set the scenario of related entities, e.g:
$journey = Journey::model()->published()->with(array(
'tickets' => array('condition' => 'tickets.published = 1')
))->findByPk($journey_id);
I want to set the scenario of my "ticket" objects, at the moment I do it like this:
foreach($journey->tickets as $t){
$t->scenario = 'book';
}
But this loop seems wasteful, is there a way to set the scenario with the initial object creation?
Thanks.