当前位置: 首页>>代码示例>>PHP>>正文


PHP parent::_cache方法代码示例

本文整理汇总了PHP中parent::_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP parent::_cache方法的具体用法?PHP parent::_cache怎么用?PHP parent::_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parent的用法示例。


在下文中一共展示了parent::_cache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setOptions

 /**
  * Sets class wide options, if no option was given, the actual set options will be returned
  *
  * @param  array  $options  Options to set
  * @throws \Zend\Date\Exception
  * @return Options array if no option was given
  */
 public static function setOptions(array $options = array())
 {
     if (empty($options)) {
         return self::$_options;
     }
     foreach ($options as $name => $value) {
         $name = strtolower($name);
         if (array_key_exists($name, self::$_options)) {
             switch ($name) {
                 case 'format_type':
                     if (strtolower($value) != 'php' && strtolower($value) != 'iso') {
                         throw new Exception\InvalidArgumentException("Unknown format type ({$value}) for dates, only 'iso' and 'php' supported");
                         /*, 0, null, $value */
                     }
                     break;
                 case 'fix_dst':
                     if (!is_bool($value)) {
                         throw new Exception\InvalidArgumentException("'fix_dst' has to be boolean");
                         /* , 0, null, $value */
                     }
                     break;
                 case 'extend_month':
                     if (!is_bool($value)) {
                         throw new Exception\InvalidArgumentException("'extend_month' has to be boolean");
                         /* ); */
                     }
                     break;
                 case 'cache':
                     if ($value === null) {
                         parent::$_cache = null;
                     } else {
                         if (!$value instanceof \Zend\Cache\Frontend) {
                             throw new Exception\InvalidArgumentException("Instance of Zend_Cache expected");
                         }
                         parent::$_cache = $value;
                         parent::$_cacheTags = Zend_Date_DateObject::hasCacheTagSupport();
                         Cldr::setCache($value);
                     }
                     break;
                 case 'timesync':
                     if ($value === null) {
                         parent::$_defaultOffset = 0;
                     } else {
                         if (!$value instanceof TimeSync\Protocol) {
                             throw new Exception\InvalidArgumentException("Instance of Zend_TimeSync expected for option timesync");
                         }
                         $date = $value->getInfo();
                         parent::$_defaultOffset = $date['offset'];
                     }
                     break;
             }
             self::$_options[$name] = $value;
         } else {
             throw new Exception\InvalidArgumentException("Unknown option: {$name} = {$value}");
         }
     }
 }
开发者ID:navtis,项目名称:xerxes-pazpar2,代码行数:64,代码来源:Date.php

示例2: setOptions

 /**
  * Sets class wide options, if no option was given, the actual set options will be returned
  *
  * @param  array  $options  Options to set
  * @throws Zend_Date_Exception
  * @return Options array if no option was given
  */
 public static function setOptions(array $options = array())
 {
     if (empty($options)) {
         return self::$_options;
     }
     foreach ($options as $name => $value) {
         $name = strtolower($name);
         if (array_key_exists($name, self::$_options)) {
             switch ($name) {
                 case 'format_type':
                     if (strtolower($value) != 'php' && strtolower($value) != 'iso') {
                         require_once 'Zend/Date/Exception.php';
                         throw new Zend_Date_Exception("Unknown format type ({$value}) for dates, only 'iso' and 'php' supported", 0, null, $value);
                     }
                     break;
                 case 'fix_dst':
                     if (!is_bool($value)) {
                         require_once 'Zend/Date/Exception.php';
                         throw new Zend_Date_Exception("'fix_dst' has to be boolean", 0, null, $value);
                     }
                     break;
                 case 'extend_month':
                     if (!is_bool($value)) {
                         require_once 'Zend/Date/Exception.php';
                         throw new Zend_Date_Exception("'extend_month' has to be boolean", 0, null, $value);
                     }
                     break;
                 case 'cache':
                     if ($value === null) {
                         parent::$_cache = null;
                     } else {
                         if (!$value instanceof Zend_Cache_Core) {
                             require_once 'Zend/Date/Exception.php';
                             throw new Zend_Date_Exception("Instance of Zend_Cache expected");
                         }
                         parent::$_cache = $value;
                         parent::$_cacheTags = Zend_Date_DateObject::_getTagSupportForCache();
                         Zend_Locale_Data::setCache($value);
                     }
                     break;
                 case 'timesync':
                     if ($value === null) {
                         parent::$_defaultOffset = 0;
                     } else {
                         if (!$value instanceof Zend_TimeSync_Protocol) {
                             require_once 'Zend/Date/Exception.php';
                             throw new Zend_Date_Exception("Instance of Zend_TimeSync expected");
                         }
                         $date = $value->getInfo();
                         parent::$_defaultOffset = $date['offset'];
                     }
                     break;
             }
             self::$_options[$name] = $value;
         } else {
             require_once 'Zend/Date/Exception.php';
             throw new Zend_Date_Exception("Unknown option: {$name} = {$value}");
         }
     }
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:67,代码来源:Date.php

示例3: setOptions

 /**
  * Sets class wide options, if no option was given, the actual set options will be returned
  *
  * @param  array  $options  Options to set
  * @throws Zend_Date_Exception
  * @return Options array if no option was given
  */
 public static function setOptions(array $options = array())
 {
     if (empty($options)) {
         return self::$_Options;
     }
     foreach ($options as $name => $value) {
         $name = strtolower($name);
         if (array_key_exists($name, self::$_Options)) {
             switch ($name) {
                 case 'format_type':
                     if (strtolower($value) != 'php' && strtolower($value) != 'iso') {
                         throw new Zend_Date_Exception("Unknown format type ({$value}) for dates, only 'iso' and 'php' supported", $value);
                     }
                     break;
                 case 'fix_dst':
                     if (!is_bool($value)) {
                         throw new Zend_Date_Exception("'fix_dst' has to be boolean", $value);
                     }
                     break;
                 case 'extend_month':
                     if (!is_bool($value)) {
                         throw new Zend_Date_Exception("'extend_month' has to be boolean", $value);
                     }
                     break;
                 case 'cache':
                     if (!$value instanceof Zend_Cache_Core) {
                         throw new Zend_Date_Exception("Instance of Zend_Cache expected");
                     }
                     parent::$_cache = $value;
                     Zend_Locale_Data::setCache($value);
                     break;
             }
             self::$_Options[$name] = $value;
         } else {
             throw new Zend_Date_Exception("Unknown option: {$name} = {$value}");
         }
     }
 }
开发者ID:sluther,项目名称:portsensor,代码行数:45,代码来源:Date.php


注:本文中的parent::_cache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。