当前位置: 首页>>代码示例>>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;未经允许,请勿转载。