本文整理匯總了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;
}
示例2: fetchByPolicyID
static function fetchByPolicyID($policyID, $asObject = true)
{
return eZPersistentObject::fetchObjectList(eZPolicyLimitation::definition(), null, array("policy_id" => $policyID), null, null, $asObject);
}