public function __construct(Event $event) { $event_type = $event->eventType->class_name; if ($event_type != 'OphCoTherapyapplication') { throw new Exception("Passed an event of type '{$event_type}'"); } $this->event = $event; }