コード例 #1
0
ファイル: EntityProvider.php プロジェクト: bapcat/unifi
 public function register()
 {
     $this->registerSite();
     $this->registerAccessPoint();
     $this->registerEvent();
     $this->registerGuest();
     //@TODO hardcoded values
     $this->ioc->bind(Connection::class, function () {
         $connection = new Connection(['driver' => 'mongodb', 'host' => 'localhost', 'port' => 27117, 'database' => 'ace', 'username' => '', 'password' => '', 'options' => ['db' => 'admin']]);
         $connection->useDefaultQueryGrammar();
         return $connection;
     });
     $this->ioc->bind(SiteGateway::class, function () {
         return new SiteGateway($this->ioc->make(Connection::class));
     });
     $this->ioc->bind(AccessPointGateway::class, function () {
         return new AccessPointGateway($this->ioc->make(Connection::class));
     });
     $this->ioc->bind(EventGateway::class, function () {
         return new EventGateway($this->ioc->make(Connection::class));
     });
     $this->ioc->bind(GuestGateway::class, function () {
         return new GuestGateway($this->ioc->make(Connection::class));
     });
 }
コード例 #2
0
ファイル: _ide_helper.php プロジェクト: ryutaroOuchi/Laravel
 /**
  * Set the query grammar to the default implementation.
  *
  * @return void 
  * @static 
  */
 public static function useDefaultQueryGrammar()
 {
     //Method inherited from \Illuminate\Database\Connection
     \Jenssegers\Mongodb\Connection::useDefaultQueryGrammar();
 }