本文整理汇总了PHP中Illuminate\Database\DatabaseManager::getDoctrineSchemaManager方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::getDoctrineSchemaManager方法的具体用法?PHP DatabaseManager::getDoctrineSchemaManager怎么用?PHP DatabaseManager::getDoctrineSchemaManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager::getDoctrineSchemaManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupTables
private function setupTables()
{
if (!is_null($this->tables)) {
$this->tables = explode(',', $this->tables);
} else {
$schema = $this->db->getDoctrineSchemaManager();
$this->tables = $schema->listTableNames();
}
}
示例2: getColumns
/**
* Fetch the table fields for the class.
*
* @param string $tableName
* @return array
*/
public function getColumns($tableName)
{
// We only want to fetch the table details
// once. We'll store these fields with a
// $columns property for future fetching.
if (isset(static::$columns[$this->tableName])) {
return static::$columns[$this->tableName];
}
// This will only run the first time the factory is created.
return static::$columns[$this->tableName] = $this->db->getDoctrineSchemaManager()->listTableDetails($tableName)->getColumns();
}
示例3: getColumns
/**
* Fetch the table fields for the class.
*
* @param string $tableName
* @return array
*/
public function getColumns($tableName)
{
// We only want to fetch the table details
// once. We'll store these fields with a
// $columns property for future fetching.
if (isset(static::$columns[$this->tableName])) {
return static::$columns[$this->tableName];
}
$schema_manager = $this->db->getDoctrineSchemaManager($tableName);
// map enum and set to string, since they are not supported yet by doctrine
$schema_manager->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$schema_manager->getDatabasePlatform()->registerDoctrineTypeMapping('set', 'string');
// This will only run the first time the factory is created.
return static::$columns[$this->tableName] = $schema_manager->listTableColumns($tableName);
}
示例4: initializeTruncate
private function initializeTruncate()
{
$schema = $this->db->getDoctrineSchemaManager();
$tables = $schema->listTableNames();
$this->truncateTables($tables);
}