BaseEventTypeController::initWithEventId PHP Method

initWithEventId() protected method

Intialise controller property based off the event id.
protected initWithEventId ( $id )
$id
    protected function initWithEventId($id)
    {
        $criteria = new CDbCriteria();
        $criteria->addCondition('event_type_id = ?');
        $criteria->params = array($this->event_type->id);
        if (!$id || !($this->event = Event::model()->findByPk($id, $criteria))) {
            throw new CHttpException(404, 'Invalid event id.');
        }
        $this->patient = $this->event->episode->patient;
        $this->episode = $this->event->episode;
    }
BaseEventTypeController