/** * Check if entity is satisfied by * @param Entity $entity The entity. * @param array $condtion The condition. * * @return bool */ private function satisfiesCondition(Entity $entity, $condtion) { if ($condtion['operation'] === static::OPERATION_EQUALS) { $operation = Comparison::EQUALS; } else { $operation = $condtion['operation']; } return Comparison::compare($entity->getProperty($condtion['property']), $condtion['value'], $operation); }
/** * {@inheritdoc} */ public function match(Transition $transition, Item $item, Context $context, ErrorCollection $errorCollection) { $value = $this->getEntityValue($item->getEntity()); if (Comparison::compare($value, $this->value, $this->operator)) { return true; } $errorCollection->addError('transition.condition.property.failed', array($this->property, $value, $this->operator, $this->value)); return false; }