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


PHP SchemaTool::getAllMetadata方法代碼示例

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


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

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if ($this->option('sql')) {
         $this->info('Outputting create query:');
         $sql = $this->tool->getCreateSchemaSql($this->metadata->getAllMetadata());
         $this->info(implode(';' . PHP_EOL, $sql));
     } else {
         $this->info('Creating database schema...');
         $this->tool->createSchema($this->metadata->getAllMetadata());
         $this->info('Schema has been created!');
     }
 }
開發者ID:jonesio,項目名稱:laravel-doctrine,代碼行數:17,代碼來源:SchemaCreateCommand.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $sql = $this->tool->getDropSchemaSQL($this->metadata->getAllMetadata());
     if (empty($sql)) {
         $this->info('Current models do not exist in schema.');
         return;
     }
     if ($this->option('sql')) {
         $this->info('Outputting drop query:');
         $this->info(implode(';' . PHP_EOL, $sql));
     } else {
         $this->info('Dropping database schema....');
         $this->tool->dropSchema($this->metadata->getAllMetadata());
         $this->info('Schema has been dropped!');
     }
 }
開發者ID:jonesio,項目名稱:laravel-doctrine,代碼行數:21,代碼來源:SchemaDropCommand.php

示例3: fire

 public function fire()
 {
     if ($this->option('sql')) {
         $this->info('Outputting create query:' . PHP_EOL);
         $sql = $this->tool->getCreateSchemaSql($this->metadata->getAllMetadata());
         $this->info(implode(';' . PHP_EOL, $sql) . ';');
     } else {
         if ($this->option('commit')) {
             $this->info('Creating database schema...');
             $this->tool->createSchema($this->metadata->getAllMetadata());
             $this->info('Schema has been created!');
         } else {
             $this->comment("Warning: this command can cause data loss. Run with --sql or --commit.");
         }
     }
 }
開發者ID:opensolutions,項目名稱:doctrine2bridge-l5,代碼行數:16,代碼來源:Create.php

示例4: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->info('Checking if database needs updating....');
     $clean = $this->option('clean');
     $sql = $this->tool->getUpdateSchemaSql($this->metadata->getAllMetadata(), !$clean);
     if (empty($sql)) {
         $this->info('No updates found.');
         return;
     }
     if ($this->option('sql')) {
         $this->info('Outputting update query:');
         $this->info(implode(';' . PHP_EOL, $sql));
     } else {
         $this->info('Updating database schema....');
         $this->tool->updateSchema($this->metadata->getAllMetadata(), !$clean);
         $this->info('Schema has been updated!');
     }
 }
開發者ID:rsamborski,項目名稱:laravel-doctrine,代碼行數:23,代碼來源:SchemaUpdateCommand.php

示例5: fire

 public function fire()
 {
     $sql = $this->tool->getDropSchemaSQL($this->metadata->getAllMetadata());
     if (empty($sql)) {
         $this->error('Current models do not exist in schema.');
         return;
     }
     if ($this->option('sql')) {
         $this->info('Outputting drop query:' . PHP_EOL);
         $this->line(implode(';' . PHP_EOL, $sql) . ';');
     } else {
         if ($this->option('commit')) {
             $this->info('Dropping database schema....');
             $this->tool->dropSchema($this->metadata->getAllMetadata());
             $this->info('Schema has been dropped!');
         } else {
             $this->comment("Warning: this command can cause data loss. Run with --sql or --commit.");
         }
     }
 }
開發者ID:jeanbelhache,項目名稱:doctrine2-l5,代碼行數:20,代碼來源:Drop.php

示例6: fire

 public function fire()
 {
     $this->info('Checking if database needs updating....');
     $sql = $this->tool->getUpdateSchemaSql($this->metadata->getAllMetadata(), $this->option('clean'));
     if (empty($sql)) {
         $this->info('No updates found.');
         return;
     }
     if ($this->option('sql')) {
         $this->info('Outputting update query:');
         $this->info(implode(';' . PHP_EOL, $sql) . ';');
     } else {
         if ($this->option('commit')) {
             $this->info('Updating database schema....');
             $this->tool->updateSchema($this->metadata->getAllMetadata());
             $this->info('Schema has been updated!');
         } else {
             $this->comment("Warning: this command can cause data loss. Run with --sql or --commit.");
         }
     }
 }
開發者ID:opensolutions,項目名稱:doctrine2bridge-l5,代碼行數:21,代碼來源:Update.php


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