setMetadataDriverImpl() публичный Метод

Sets the cache driver implementation that is used for metadata caching.
public setMetadataDriverImpl ( Doctrine\Common\Persistence\Mapping\Driver\MappingDriver $driverImpl )
$driverImpl Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
 public function createConfiguration($metaDriver)
 {
     $config = new Configuration();
     $config->setProxyDir(\sys_get_temp_dir());
     $config->setAutoGenerateProxyClasses(true);
     $config->setMetadataDriverImpl($metaDriver);
     $config->setMetadataCacheImpl(new ArrayCache());
     $config->setLuceneHandlerName('_fti');
     return $config;
 }
Пример #2
0
	static public function createOdm(
		$database, $host = 'localhost', $port = '5984', 
		$username = null, $password = null,
		array $path = array(),
		$namespace = 'Doctrine\ODM\CouchDB\Mapping\\')
	{
		$driver = self::loadDriverForDocuments($path, $namespace);
		
		$config = new Configuration();
		$config->setDatabase($database);
		$config->setMetadataDriverImpl($driver);

		$httpClient = new SocketClient($host, $port, $username, $password);
		$config->setHttpClient($httpClient);
		
		return DocumentManager::create($config);
	}
 public function createDocumentManager()
 {
     $couchDBClient = $this->createCouchDBClient();
     $httpClient = $couchDBClient->getHttpClient();
     $database = $couchDBClient->getDatabase();
     $httpClient->request('DELETE', '/' . $database);
     $resp = $httpClient->request('PUT', '/' . $database);
     $reader = new AnnotationReader();
     $reader->setDefaultAnnotationNamespace('Doctrine\\ODM\\CouchDB\\Mapping\\');
     $paths = __DIR__ . "/../../Models";
     $metaDriver = new AnnotationDriver($reader, $paths);
     $config = new Configuration();
     $config->setProxyDir(\sys_get_temp_dir());
     $config->setMetadataDriverImpl($metaDriver);
     $setMetadataCacheImpl = $config->setMetadataCacheImpl(new ArrayCache());
     $config->setLuceneHandlerName('_fti');
     return DocumentManager::create($couchDBClient, $config);
 }