public function getTicketForEvent($event) { if ($event->id) { return Ticket::model()->findByAttributes(array('event_id' => $event->id)); } }