當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Doctrine_Manager::setAttribute方法代碼示例

本文整理匯總了PHP中Doctrine_Manager::setAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Manager::setAttribute方法的具體用法?PHP Doctrine_Manager::setAttribute怎麽用?PHP Doctrine_Manager::setAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine_Manager的用法示例。


在下文中一共展示了Doctrine_Manager::setAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: configureDoctrine

 /**
  * 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);
 }
開發者ID:naturalsciences,項目名稱:Darwin,代碼行數:10,代碼來源:ProjectConfiguration.class.php

示例2: configureDoctrineCache

 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));
     }
 }
開發者ID:roozbeh360,項目名稱:diem,代碼行數:9,代碼來源:dmProjectConfiguration.php

示例3: configureDoctrine

 /**
  * 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');
 }
開發者ID:rabbitdigital,項目名稱:HRM,代碼行數:15,代碼來源:orangehrmConfiguration.class.php

示例4: __construct

 /**
  *
  */
 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');
 }
開發者ID:networksoft,項目名稱:networksoft.com.co,代碼行數:18,代碼來源:Doctrine.php

示例5: configureDoctrine

 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);
 }
開發者ID:stinol,項目名稱:PHPTest,代碼行數:17,代碼來源:ProjectConfiguration.class.php

示例6: configureDoctrine

 /**
  * 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);
     }
 }
開發者ID:CamilleCrespeau,項目名稱:orangehrm,代碼行數:21,代碼來源:orangehrmConfiguration.class.php

示例7: configureDoctrine

 /**
  * Настройки 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');
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:21,代碼來源:ProjectConfiguration.class.php

示例8: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
   $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true);
   
   $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'myDoctrineQuery');
 }
開發者ID:romankallweit,項目名稱:swingmachine,代碼行數:6,代碼來源:ProjectConfiguration.class.php

示例9: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
     $manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, false);
 }
開發者ID:jamespaulmuir,項目名稱:cotinga,代碼行數:4,代碼來源:ProjectConfiguration.class.php

示例10: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
     //Adding my own Doctrine_Collection class
     $manager->setAttribute(Doctrine::ATTR_COLLECTION_CLASS, 'cukorkaCollection');
 }
開發者ID:szelpe,項目名稱:cukorka,代碼行數:5,代碼來源:frontendConfiguration.class.php

示例11: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
     // Enable callbacks so that softDelete behavior can be used
     $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true);
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:5,代碼來源:ProjectConfiguration.class.php

示例12: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
     $manager->setAttribute(Doctrine_Core::ATTR_COLLECTION_CLASS, 'Doctrine_Collection_Extra');
 }
開發者ID:robertsergio,項目名稱:Hadori-Demo,代碼行數:4,代碼來源:ProjectConfiguration.class.php

示例13: configureDoctrine

 public function configureDoctrine(Doctrine_Manager $manager)
 {
     $manager->setAttribute(Doctrine::ATTR_IDXNAME_FORMAT, '%s');
     $manager->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true);
 }
開發者ID:kriswallsmith,項目名稱:symfony-installer,代碼行數:5,代碼來源:ProjectConfiguration.class.php

示例14: configureDoctrine

 /**
  * Настройки 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);
 }
開發者ID:pycmam,項目名稱:neskuchaik.ru,代碼行數:9,代碼來源:ProjectConfiguration.class.php

示例15: configureDoctrine

 /**
  * Configure the Doctrine engine
  */
 public function configureDoctrine(Doctrine_Manager $manager)
 {
     $manager->setAttribute(Doctrine_Core::ATTR_QUERY_CLASS, 'Doctrine_Query_Extra');
 }
開發者ID:bshaffer,項目名稱:Donate-Nashville,代碼行數:7,代碼來源:ProjectConfiguration.class.php


注:本文中的Doctrine_Manager::setAttribute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。