我在實體本身看到我可以將set the schema作爲一個選項,但有沒有在公共模式之外生成實體的選項?doctrine在公共模式之外生成實體
這裏是公共架構是什麼在起作用
php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force
php app/console doctrine:mapping:import AcmeBlogBundle annotation
php app/console doctrine:generate:entities AcmeBlogBundle
也許是這樣的:
php app/console doctrine:mapping:convert xml schema=Foo ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force
僅供參考,我們使用PostgreSQL 8.x的& 9.x中作爲我們的數據庫& Symfony的2.1.3如果那麼重要
更新:
我想這就是我正在尋找,但需要一種方法來設置模式陣列值:
/**
* Sets the table name.
*
* @param string $name
*
* @return ClassMetadataBuilder
*/
public function setTable($name)
{
$this->cm->setPrimaryTable(array('name' => $name));
return $this;
}
更新#2
我想這可能是可能在連接配置中設置此項
原始配置
# Doctrine Configuration
doctrine:
dbal:
default_connection: my_database
connections:
my_database:
driver: pdo_pgsql
port: 5432
dbname: bar
user: foo_user
password: foo_pass
charset: UTF8
集的模式:
# Doctrine Configuration
doctrine:
dbal:
default_connection: my_database
connections:
my_database:
driver: pdo_pgsql
port: 5432
dbname: bar/Foo
user: foo_user
password: foo_pass
charset: UTF8