protected function getEventType() { $eventType = \EventType::model()->findByAttributes(array('class_name' => 'OphCoMessaging')); if (!$eventType) { throw new \CDbException('Event Type for messaging not found'); } return $eventType; }