static function removeByValue($value, $policyID = false)
 {
     if ($policyID) {
         $limitationIDList = array();
         $limitations = eZPolicyLimitation::fetchByPolicyID($policyID, false);
         foreach ($limitations as $limitationArray) {
             $limitationIDList[] = $limitationArray['id'];
         }
         if (count($limitationIDList) > 0) {
             eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array('limitation_id' => array($limitationIDList), "value" => $value));
             return;
         }
     }
     eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array("value" => $value));
 }
예제 #2
0
 function valueList()
 {
     if (!isset($this->Values)) {
         $values = eZPersistentObject::fetchObjectList(eZPolicyLimitationValue::definition(), null, array('limitation_id' => $this->attribute('id')), null, null, true);
         if ($this->LimitValue) {
             $values[] = new eZPolicyLimitationValue(array('id' => -1, 'value' => $this->LimitValue));
         }
         $this->Values = $values;
     }
     return $this->Values;
 }