Inheritance: extends Sulu\Component\Rest\ApiWrapper
Beispiel #1
0
 /**
  * Creates a conditions for a condition group.
  *
  * @param ConditionGroup $conditionGroup
  *
  * @throws ConditionFieldNotFoundException
  * @throws FeatureNotImplementedException
  */
 protected function processConditionGroup(ConditionGroup $conditionGroup)
 {
     $condition = $conditionGroup->getConditions()[0];
     $fieldDescriptor = $this->listBuilder->getFieldDescriptor($condition->getField());
     if (!$fieldDescriptor) {
         throw new ConditionFieldNotFoundException($condition->getField());
     }
     if (count($conditionGroup->getConditions()) === 1) {
         $this->createExpression($condition, $fieldDescriptor);
     } elseif (count($conditionGroup->getConditions()) > 1) {
         // TODO implement if needed
         throw new FeatureNotImplementedException('Multiple condition handling not yet implemented!');
     }
 }
Beispiel #2
0
 /**
  * Remove conditionGroup.
  *
  * @param ConditionGroup $conditionGroup
  */
 public function removeConditionGroup(ConditionGroup $conditionGroup)
 {
     $this->entity->removeConditionGroup($conditionGroup->getEntity());
 }
Beispiel #3
0
 /**
  * Set conditionGroup.
  *
  * @param ConditionGroup $conditionGroup
  */
 public function setConditionGroup(ConditionGroup $conditionGroup)
 {
     $this->entity->setConditionGroup($conditionGroup->getEntity());
 }