Example #1
0
 /**
  * @see MetaborStd\Statemachine.TransitionInterface::isActive()
  */
 public function isActive($subject, \ArrayAccess $context, EventInterface $event = null)
 {
     if ($event) {
         $result = $event->getName() == $this->eventName;
     } else {
         $result = is_null($this->eventName);
     }
     if ($this->condition) {
         $result = $result && $this->condition->checkCondition($subject, $context);
     }
     return $result;
 }
Example #2
0
 /**
  *
  * @see MetaborStd\Statemachine.ConditionInterface::checkCondition()
  */
 public function checkCondition($subject, ArrayAccess $context)
 {
     return !$this->condition->checkCondition($subject, $context);
 }