的字段說明如下:
如果
* @param array $paths
* @param boolean $isDevMode
* @param string $proxyDir
* @param Cache $cache
* @param bool $useSimpleAnnotationReader
不知道這會幫助,但我總是做這做定製的東西,當...
use Doctrine\Common\EventManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
// Class definition and method ... {
$params = 'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => '127.0.0.1',
'dbname' => 'dbname',
'user' => 'myuser',
'password' => 'mypass',
),
);
$eventManager = new EventManager();
$config = Setup::createAnnotationMetadataConfiguration(array(), false, 'data/DoctrineORMModule/Proxy', null, false);
$connection = DriverManager::getConnection($params,
$config,
$eventManager
);
$objectManager = EntityManager::create($connection, $config, $eventManager);
謝謝。我儘量嘗試。 – user2670354