LMongo\Connection::setEventDispatcher PHP Method

setEventDispatcher() public method

Set the event dispatcher instance on the connection.
public setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void
$events Illuminate\Events\Dispatcher
return void
    public function setEventDispatcher(\Illuminate\Events\Dispatcher $events)
    {
        $this->events = $events;
    }

Usage Example

Beispiel #1
0
 /**
  * Prepare the database connection instance.
  *
  * @param  Illuminate\Database\Connection  $connection
  * @return Illuminate\Database\Connection
  */
 protected function prepare(Connection $connection)
 {
     $connection->setEventDispatcher($this->app['events']);
     // We will setup a Closure to resolve the paginator instance on the connection
     // since the Paginator isn't sued on every request and needs quite a few of
     // our dependencies. It'll be more efficient to lazily resolve instances.
     $app = $this->app;
     $connection->setPaginator(function () use($app) {
         return $app['paginator'];
     });
     return $connection;
 }
All Usage Examples Of LMongo\Connection::setEventDispatcher