public function notify($eventType, ModelInterface $model)
{
switch ($eventType) {
case 'beforeCreate':
case 'beforeDelete':
case 'beforeUpdate':
if (!$this->ignoreEvent) {
throw new Exception(sprintf('You should not use %s:%s when %s attached. Use the methods of behavior.', get_class($model), $eventType, __CLASS__));
}
break;
}
}