當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConnectionResolverInterface::setDefaultConnection方法代碼示例

本文整理匯總了PHP中Illuminate\Database\ConnectionResolverInterface::setDefaultConnection方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConnectionResolverInterface::setDefaultConnection方法的具體用法?PHP ConnectionResolverInterface::setDefaultConnection怎麽用?PHP ConnectionResolverInterface::setDefaultConnection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\ConnectionResolverInterface的用法示例。


在下文中一共展示了ConnectionResolverInterface::setDefaultConnection方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }
開發者ID:pin-cnx,項目名稱:orientdb-laravel-5,代碼行數:13,代碼來源:SeedCommand.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->__invoke();
     });
 }
開發者ID:bryanashley,項目名稱:framework,代碼行數:15,代碼來源:SeedCommand.php

示例3: handle

 /**
  * @return mixed
  */
 public function handle()
 {
     // TODO: Implement handle() method.
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->run();
     });
 }
開發者ID:filipveschool,項目名稱:packagegenerator,代碼行數:14,代碼來源:MakeSeederCommand.php

示例4: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $tenants = $this->manager->getRepository()->getTenants();
     $seeder = $this->getSeeder();
     foreach ($tenants as $tenant) {
         $this->manager->bootstrapConnectionByTenantName($tenant->tenant_name);
         $this->resolver->setDefaultConnection($tenant->tenant_name);
         $this->manager->assumeTenant($tenant->id, true);
         $seeder->run();
         $this->output->writeln('<info>Seeded tenant ' . $tenant->tenant_name . '</info>');
         $this->manager->restoreTenant();
     }
 }
開發者ID:stillat,項目名稱:database,代碼行數:18,代碼來源:SeedCommand.php

示例5: setConnection

 /**
  * Set the default connection name.
  *
  * @param  string  $name
  * @return void
  */
 public function setConnection($name)
 {
     if (!is_null($name)) {
         $this->resolver->setDefaultConnection($name);
     }
     $this->repository->setSource($name);
     $this->connection = $name;
 }
開發者ID:EnmanuelCode,項目名稱:backend-laravel,代碼行數:14,代碼來源:Migrator.php

示例6: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }
開發者ID:flelievre,項目名稱:EasyVisit,代碼行數:10,代碼來源:SeedCommand.php


注:本文中的Illuminate\Database\ConnectionResolverInterface::setDefaultConnection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。