Beispiel #1
0
 /**
  * Remove all of the event listeners for the class.
  *
  * @return void
  */
 public static function flushEventListeners()
 {
     if (!isset(static::$dispatcher)) {
         return;
     }
     foreach (static::getObservableEvents() as $event) {
         static::$dispatcher->forget("{$event}: " . get_called_class());
     }
 }
Beispiel #2
0
 /**
  * Remove a set of listeners from the dispatcher.
  *
  * @param string $event
  * @return void 
  * @static 
  */
 public static function forget($event)
 {
     \Illuminate\Events\Dispatcher::forget($event);
 }
 /**
  * Remove all of the event listeners for the model.
  *
  * @return void
  */
 public static function flushEventListeners()
 {
     if (!isset(static::$dispatcher)) {
         return;
     }
     $instance = new static();
     foreach ($instance->getObservableEvents() as $event) {
         static::$dispatcher->forget("eloquent.{$event}: " . get_called_class());
     }
 }