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


PHP eZPolicyLimitation::definition方法代碼示例

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


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

示例1: 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

示例2: fetchByPolicyID

 static function fetchByPolicyID($policyID, $asObject = true)
 {
     return eZPersistentObject::fetchObjectList(eZPolicyLimitation::definition(), null, array("policy_id" => $policyID), null, null, $asObject);
 }
開發者ID:nfrp,項目名稱:ezpublish,代碼行數:4,代碼來源:ezpolicylimitation.php


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