本文整理匯總了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);
}