Example #1
0
 /**
  * {@inheritdoc}
  */
 public function isAllowed($context, Collection $errors = null)
 {
     if (!$this->condition) {
         $this->condition = $this->assembler->assemble($this->configuration);
     }
     return $this->condition->isAllowed($context, $errors);
 }
Example #2
0
 /**
  * @param mixed $context
  * @return bool
  */
 protected function isAllowed($context)
 {
     if (!$this->condition) {
         return true;
     }
     return $this->condition->isAllowed($context);
 }
Example #3
0
 /**
  * Returns negation of embedded condition
  *
  * @param mixed $context
  * @param Collection|null $errors
  * @return boolean
  */
 public function isAllowed($context, Collection $errors = null)
 {
     $isAllowed = !$this->condition->isAllowed($context, $errors);
     if (!$isAllowed) {
         $this->addError($context, $errors);
     }
     return $isAllowed;
 }
Example #4
0
 /**
  * Check is transition pre condition is allowed for current workflow item.
  *
  * @param WorkflowItem $workflowItem
  * @param Collection|null $errors
  * @return boolean
  */
 protected function isPreConditionAllowed(WorkflowItem $workflowItem, Collection $errors = null)
 {
     if (!$this->preCondition) {
         return true;
     }
     return $this->preCondition->isAllowed($workflowItem, $errors);
 }