LMongo\Eloquent\Model::setEventDispatcher PHP Method

setEventDispatcher() public static method

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void
$dispatcher Illuminate\Events\Dispatcher
return void
    public static function setEventDispatcher(Dispatcher $dispatcher)
    {
        static::$dispatcher = $dispatcher;
    }

Usage Example

示例#1
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     Model::setConnectionResolver($this->app['lmongo']);
     Model::setEventDispatcher($this->app['events']);
 }
Model