I am having some serious headspins over this issue, my relation is setup in the Model, as well as being loaded in the controller. My code in he Model:
'proposed' => array(
self::MANY_MANY,
'Person',
'tbl_models_events(model_id, event_id)',
'condition' => 'proposed_proposed.status_id = :status',
'params' => array(':status' => Lookup::item('ModelsEventStatus', ModelsEvents::STATUS_PROPOSED)),
'together' => false
),
My code in the controller:
public function actionView($id) {
$event = Event::model()->with('confirmed', 'proposed')->findByPk((int) $id);
$event->address = Address::model()->findByPk($event->address_id);
$this->render('view', array(
'event' => $event,
));
}
i var_dump the result, and even though I have records in the db that match the criteria but i get empty result sets…
Is my relation not correct or what am I doing wrong?