/** * Configure the Doctrine engine **/ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, new Doctrine_Cache_Apc()); $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, new Doctrine_Cache_Apc()); $options = array('baseClassName' => 'DarwinModel'); sfConfig::set('doctrine_model_builder_options', $options); }
protected function configureDoctrineCache(Doctrine_Manager $manager) { if (sfConfig::get('dm_orm_cache_enabled', true) && dmAPCCache::isEnabled()) { $driver = new Doctrine_Cache_Apc(array('prefix' => dmProject::getNormalizedRootDir() . '/doctrine/')); $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $driver); $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, $driver); $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE_LIFESPAN, sfConfig::get('dm_orm_cache_lifespan', 3600)); } }
/** * Configure doctrine connections to use tablename prefix hs_hr_ */ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL); $manager->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true); // // If using encryption, enable dql callbacks. Needed by EncryptionListener // if (KeyHandler::keyExists()) { $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); } //$manager->setAttribute(Doctrine::ATTR_TBLNAME_FORMAT, 'hs_hr_%s'); }
/** * */ protected function __construct() { if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); } $this->loadPlatformInstance(); // load the doctrine class loader spl_autoload_register(array('Doctrine', 'autoload')); // Load up the manager and put base settings $this->manager = Doctrine_Manager::getInstance(); $this->manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_PEAR); $this->manager->setAttribute(Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true); $this->_initializeExtensions(); $this->connection = Doctrine_Manager::connection($this->platform_instance->getConnectionUrl(), 'default'); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); $manager->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true); // $cacheConn = Doctrine_Manager::connection(new PDO('sqlite::memory:')); // $cacheDriver = new Doctrine_Cache_Db(array('connection' => $cacheConn, 'tableName' =>'cache')); // $cacheDriver->createTable(); // $cacheDriver = new Doctrine_Cache_Memcache(); // $cacheDriver = new Doctrine_Cache_Apc(); // $cacheDriver = new Doctrine_Cache_Array(); // $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, $cacheDriver); // $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver); // $manager->setAttribute(Doctrine_Core::ATTR_QUERY_LIMIT, Doctrine_Core::LIMIT_RECORDS); $manager->setAttribute(Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_EMPTY_TO_NULL); // $options = array('baseClassName' => 'BaseDoctrineRecord'); // sfConfig::set('doctrine_model_builder_options', $options); }
/** * Configure doctrine connections to use tablename prefix hs_hr_ */ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL); $manager->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true); $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'ohrmDoctrineQuery'); // // If using encryption, enable dql callbacks. Needed by EncryptionListener // if (KeyHandler::keyExists()) { $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); } //$manager->setAttribute(Doctrine::ATTR_TBLNAME_FORMAT, 'hs_hr_%s'); // Allow running doctrine:build-schema without error $isCli = php_sapi_name() == "cli"; if (true == $isCli) { Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, false); } }
/** * Настройки Doctrine */ public function configureDoctrine(Doctrine_Manager $manager) { // Legacy database $manager->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); // $manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, false); $manager->setAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET, 'utf8'); $manager->setAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE, 'utf8_general_ci'); $manager->setAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_TYPE, 'INNODB'); // Глобальный кастомный Query класс // @see http://www.doctrine-project.org/projects/orm/1.2/docs/manual/configuration/en#configure-query-class $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'myBaseQuery'); // SoftDelete $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); // что бы использовать IF | CASE и проч. SQL-полезняшки $manager->setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_ALL ^ Doctrine::PORTABILITY_EXPR); // Кастомный гидратор $manager->registerHydrator('FetchPair', 'Doctrine_Hydrator_FetchPair'); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'myDoctrineQuery'); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, false); }
public function configureDoctrine(Doctrine_Manager $manager) { //Adding my own Doctrine_Collection class $manager->setAttribute(Doctrine::ATTR_COLLECTION_CLASS, 'cukorkaCollection'); }
public function configureDoctrine(Doctrine_Manager $manager) { // Enable callbacks so that softDelete behavior can be used $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_COLLECTION_CLASS, 'Doctrine_Collection_Extra'); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine::ATTR_IDXNAME_FORMAT, '%s'); $manager->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true); }
/** * Настройки Doctrine */ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine::ATTR_QUERY_CLASS, 'MyQuery'); $manager->setAttribute(Doctrine::ATTR_USE_DQL_CALLBACKS, true); $manager->setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER, true); }
/** * Configure the Doctrine engine */ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'Doctrine_Query_Extra'); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, true); $options = array('baseClassName' => 'myDoctrineRecord'); sfConfig::set('doctrine_model_builder_options', $options); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setCharset('utf8'); $manager->setCollate('utf8_unicode_ci'); $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, new Doctrine_Cache_Apc()); }
/** * Configure the Doctrine engine **/ public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, new Doctrine_Cache_Apc()); }
public function configureDoctrine(Doctrine_Manager $manager) { $manager->setAttribute(Doctrine_Core::ATTR_RESULT_CACHE, new Doctrine_Cache_Array()); }