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


PHP eZPolicyLimitation::setAttribute方法代码示例

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


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

示例1: createNew

 static function createNew($policyID, $identifier)
 {
     $policyParameter = new eZPolicyLimitation(array());
     $policyParameter->setAttribute('policy_id', $policyID);
     $policyParameter->setAttribute('identifier', $identifier);
     $policyParameter->store();
     return $policyParameter;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:8,代码来源:ezpolicylimitation.php

示例2: limitationList

 function limitationList($useCache = true, $ignoreLimitIdentifier = false)
 {
     if (!isset($this->Limitations) || !$useCache) {
         $limitations = eZPersistentObject::fetchObjectList(eZPolicyLimitation::definition(), null, array('policy_id' => $this->attribute('id')), null, null, true);
         eZDebugSetting::writeDebug('kernel-policy-limitation', $limitations, "before policy limitations " . $this->ID);
         eZDebugSetting::writeDebug('kernel-policy-limitation', $this, "policy itself before before limitations check");
         if ($ignoreLimitIdentifier === false && isset($this->LimitIdentifier) && $this->LimitIdentifier) {
             $limitIdentifier = $this->attribute('limit_identifier');
             $limitValue = $this->attribute('limit_value');
             $limitationTouched = false;
             $checkEmptyLimitation = true;
             foreach ($limitations as $limitation) {
                 if ($limitation->attribute('identifier') == $limitIdentifier) {
                     if ($limitIdentifier == 'Subtree') {
                         $limitationTouched = true;
                         $values = $limitation->attribute('values');
                         foreach ($values as $limitationValue) {
                             $value = $limitationValue->attribute('value');
                             if (strpos($value, $limitValue) === 0) {
                                 $checkEmptyLimitation = false;
                                 eZDebugSetting::writeDebug('kernel-policy-limitation', $value, "Limitationvalue has been left in the limitation [limitValue={$limitValue}]");
                             } else {
                                 if (strpos($limitValue, $value) === 0) {
                                     $checkEmptyLimitation = false;
                                     $limitationValue->setAttribute('value', $limitValue);
                                     eZDebugSetting::writeDebug('kernel-policy-limitation', $value, "Limitationvalue has been exchanged to the value from cond assignment [limitValue={$limitValue}]");
                                 } else {
                                     eZDebugSetting::writeDebug('kernel-policy-limitation', $value, "Limitationvalue has been removed from limitation [limitValue={$limitValue}]");
                                     //exlude limitation value from limitation..
                                     unset($limitationValue);
                                 }
                             }
                         }
                         if ($checkEmptyLimitation) {
                             eZDebugSetting::writeDebug('kernel-policy-limitation', $this, 'The policy has been disabled');
                             $this->Disabled = true;
                             $this->Limitations = array();
                             return $this->Limitations;
                         }
                     }
                 }
             }
             if (!$limitationTouched) {
                 $policyLimitation = new eZPolicyLimitation(array('id' => -1, 'policy_id' => $this->attribute('id'), 'identifier' => $this->attribute('limit_identifier')));
                 $policyLimitation->setAttribute('limit_value', $this->attribute('limit_value'));
                 $limitations[] = $policyLimitation;
             }
         }
         eZDebugSetting::writeDebug('kernel-policy-limitation', $limitations, "policy limitations " . $this->ID);
         $this->Limitations = $limitations;
     }
     return $this->Limitations;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:53,代码来源:ezpolicy.php


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