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


PHP CustomFieldData::setNotModified方法代码示例

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


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

示例1: getByName

 /**
  * Given a name, get the custom field data model.  Attempts to retrieve from cache, if it is not available,
  * will attempt to retrieve from persistent storage, cache the model, and return.
  * @param string $name
  * @return CustomFieldData model
  * @throws NotFoundException
  */
 public static function getByName($name, $shouldCache = true)
 {
     if (isset(self::$cachedModelsByName[$name])) {
         return self::$cachedModelsByName[$name];
     }
     try {
         // not using default value to save cpu cycles on requests that follow the first exception.
         return GeneralCache::getEntry('CustomFieldData' . $name);
     } catch (NotFoundException $e) {
         assert('is_string($name)');
         assert('$name != ""');
         $bean = ZurmoRedBean::findOne('customfielddata', "name = :name ", array(':name' => $name));
         assert('$bean === false || $bean instanceof RedBean_OODBBean');
         if ($bean === false) {
             $customFieldData = new CustomFieldData();
             $customFieldData->name = $name;
             $customFieldData->serializedData = serialize(array());
             // An unused custom field data does not present as needing saving.
             $customFieldData->setNotModified();
         } else {
             $customFieldData = self::makeModel($bean);
         }
         if ($shouldCache) {
             self::$cachedModelsByName[$name] = $customFieldData;
             GeneralCache::cacheEntry('CustomFieldData' . $name, $customFieldData);
         }
         return $customFieldData;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:36,代码来源:CustomFieldData.php

示例2: getByName

 /**
  * Given a name, get the custom field data model.  Attempts to retrieve from cache, if it is not available,
  * will attempt to retrieve from persistent storage, cache the model, and return.
  * @param string $name
  */
 public static function getByName($name)
 {
     try {
         return GeneralCache::getEntry('CustomFieldData' . $name);
     } catch (NotFoundException $e) {
         assert('is_string($name)');
         assert('$name != ""');
         $bean = R::findOne('customfielddata', "name = '{$name}'");
         assert('$bean === false || $bean instanceof RedBean_OODBBean');
         if ($bean === false) {
             $customFieldData = new CustomFieldData();
             $customFieldData->name = $name;
             $customFieldData->serializedData = serialize(array());
             // An unused custom field data does not present as needing saving.
             $customFieldData->setNotModified();
             return $customFieldData;
         }
         $model = self::makeModel($bean);
         GeneralCache::cacheEntry('CustomFieldData' . $name, $model);
         return $model;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:27,代码来源:CustomFieldData.php


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