Пример #1
0
 protected function setUp()
 {
     $config = new \Kdyby\Doctrine\Configuration();
     $mapping = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(new \Doctrine\Common\Annotations\AnnotationReader(), [__DIR__ . '/entitites']);
     $config->setDefaultRepositoryClassName('Tests\\DefaultRepository');
     $config->setMetadataDriverImpl($mapping);
     $config->setProxyDir(__DIR__ . '/proxy');
     $config->setProxyNamespace('Tests\\_ProxyTests');
     \Doctrine\Common\Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
     $event = new \Doctrine\Common\EventManager();
     $conn = new \Kdyby\Doctrine\Connection(array('dbname' => 'test', 'user' => 'travis', 'password' => '', 'host' => 'localhost', 'driver' => 'pdo_mysql'), new \Doctrine\DBAL\Driver\PDOMySql\Driver(), $config, $event);
     $em = \Kdyby\Doctrine\EntityManager::create($conn, $config, $event);
     $this->helper = new \WebChemistry\Forms\Doctrine($em);
 }
 /**
  * @return Kdyby\Doctrine\Configuration
  */
 public function createServiceDoctrine__default__ormConfiguration()
 {
     $service = new Kdyby\Doctrine\Configuration();
     $service->setMetadataCacheImpl($this->getService('doctrine.cache.default.metadata'));
     $service->setQueryCacheImpl($this->getService('doctrine.cache.default.query'));
     $service->setResultCacheImpl($this->getService('doctrine.cache.default.ormResult'));
     $service->setHydrationCacheImpl($this->getService('doctrine.cache.default.hydration'));
     $service->setMetadataDriverImpl($this->getService('doctrine.default.metadataDriver'));
     $service->setClassMetadataFactoryName('Kdyby\\Doctrine\\Mapping\\ClassMetadataFactory');
     $service->setDefaultRepositoryClassName('Kdyby\\Doctrine\\EntityDao');
     $service->setProxyDir('/home/fuca/Projects/www/sportsclub/tests/tmp/proxies');
     $service->setProxyNamespace('Kdyby\\GeneratedProxy');
     $service->setAutoGenerateProxyClasses(FALSE);
     $service->setEntityNamespaces(array());
     $service->setCustomHydrationModes(array());
     $service->setCustomStringFunctions(array());
     $service->setCustomNumericFunctions(array());
     $service->setCustomDatetimeFunctions(array());
     $service->setNamingStrategy(new Doctrine\ORM\Mapping\DefaultNamingStrategy());
     $service->setQuoteStrategy(new Doctrine\ORM\Mapping\DefaultQuoteStrategy());
     $service->setEntityListenerResolver(new Kdyby\Doctrine\Mapping\EntityListenerResolver($this));
     return $service;
 }
 /**
  * @return Kdyby\Doctrine\Configuration
  */
 public function createServiceDoctrine__default__ormConfiguration()
 {
     $service = new Kdyby\Doctrine\Configuration();
     $service->setMetadataCacheImpl($this->getService('doctrine.cache.default.metadata'));
     $service->setQueryCacheImpl($this->getService('doctrine.cache.default.query'));
     $service->setResultCacheImpl($this->getService('doctrine.cache.default.ormResult'));
     $service->setHydrationCacheImpl($this->getService('doctrine.cache.default.hydration'));
     $service->setMetadataDriverImpl($this->getService('doctrine.default.metadataDriver'));
     $service->setClassMetadataFactoryName('Kdyby\\Doctrine\\Mapping\\ClassMetadataFactory');
     $service->setDefaultRepositoryClassName('Kdyby\\Doctrine\\EntityDao');
     $service->setQueryBuilderClassName('Kdyby\\Doctrine\\QueryBuilder');
     $service->setRepositoryFactory($this->getService('doctrine.default.repositoryFactory'));
     $service->setProxyDir('/home/richmond/vhosts/nette-test/sandbox/app/../temp/proxies');
     $service->setProxyNamespace('Kdyby\\GeneratedProxy');
     $service->setAutoGenerateProxyClasses(2);
     $service->setEntityNamespaces(array());
     $service->setCustomHydrationModes(array());
     $service->setCustomStringFunctions(array());
     $service->setCustomNumericFunctions(array());
     $service->setCustomDatetimeFunctions(array());
     $service->setDefaultQueryHints(array());
     $service->setNamingStrategy(new Doctrine\ORM\Mapping\UnderscoreNamingStrategy());
     $service->setQuoteStrategy(new Doctrine\ORM\Mapping\DefaultQuoteStrategy());
     $service->setEntityListenerResolver(new Kdyby\Doctrine\Mapping\EntityListenerResolver($this));
     return $service;
 }