当前位置: 首页>>代码示例>>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;未经允许,请勿转载。