本文整理匯總了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!');
}
}
示例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!');
}
}
示例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.");
}
}
}
示例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!');
}
}
示例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.");
}
}
}
示例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.");
}
}
}