Beispiel #1
0
 /**
  * Set the event id
  *
  * @param  EventId $eventId the event id
  * @throws EventException - on event type mismatch
  */
 private function setEventId(EventId $eventId)
 {
     $eventType = $eventId->eventType();
     if ($eventType != underscore($this)) {
         throw EventException::invalidType($eventType);
     }
     $this->eventId = $eventId;
 }
 /**
  * @param  string $anEventType
  * @throws InvalidEventTypeException
  */
 protected function guardEventType($anEventType)
 {
     if (!$this->isValidEventType($anEventType)) {
         throw EventException::invalidType($anEventType);
     }
 }
Beispiel #3
0
 /**
  * Protects against invalid event types
  *
  * @param  string $anEventType the event type to verify
  * @throws EventException - on invalid event type
  */
 protected function guardValidEventType($anEventType)
 {
     if (!static::validateEventType($anEventType)) {
         throw EventException::invalidType($anEventType);
     }
 }