1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Merge pull request #893 from yktd26/master

autoGenerate arg from bool to int
This commit is contained in:
Benjamin Eberlei 2014-01-02 13:03:33 -08:00
commit a2cdc7a1c7
2 changed files with 4 additions and 3 deletions

View File

@ -62,9 +62,9 @@ class ProxyFactory extends AbstractProxyFactory
* @param \Doctrine\ORM\EntityManager $em The EntityManager the new factory works for. * @param \Doctrine\ORM\EntityManager $em The EntityManager the new factory works for.
* @param string $proxyDir The directory to use for the proxy classes. It must exist. * @param string $proxyDir The directory to use for the proxy classes. It must exist.
* @param string $proxyNs The namespace to use for the proxy classes. * @param string $proxyNs The namespace to use for the proxy classes.
* @param boolean $autoGenerate Whether to automatically generate proxy classes. * @param boolean|int $autoGenerate Whether to automatically generate proxy classes.
*/ */
public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = false) public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER)
{ {
$proxyGenerator = new ProxyGenerator($proxyDir, $proxyNs); $proxyGenerator = new ProxyGenerator($proxyDir, $proxyNs);

View File

@ -10,6 +10,7 @@ use Doctrine\Tests\Mocks\ConnectionMock;
use Doctrine\Tests\Mocks\EntityManagerMock; use Doctrine\Tests\Mocks\EntityManagerMock;
use Doctrine\Tests\Mocks\UnitOfWorkMock; use Doctrine\Tests\Mocks\UnitOfWorkMock;
use Doctrine\Tests\Mocks\DriverMock; use Doctrine\Tests\Mocks\DriverMock;
use Doctrine\Common\Proxy\AbstractProxyFactory;
/** /**
* Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy pattern. * Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy pattern.
@ -47,7 +48,7 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase
$this->emMock = EntityManagerMock::create($this->connectionMock); $this->emMock = EntityManagerMock::create($this->connectionMock);
$this->uowMock = new UnitOfWorkMock($this->emMock); $this->uowMock = new UnitOfWorkMock($this->emMock);
$this->emMock->setUnitOfWork($this->uowMock); $this->emMock->setUnitOfWork($this->uowMock);
$this->proxyFactory = new ProxyFactory($this->emMock, sys_get_temp_dir(), 'Proxies', true); $this->proxyFactory = new ProxyFactory($this->emMock, sys_get_temp_dir(), 'Proxies', AbstractProxyFactory::AUTOGENERATE_ALWAYS);
} }
public function testReferenceProxyDelegatesLoadingToThePersister() public function testReferenceProxyDelegatesLoadingToThePersister()