getCondition() public method

public getCondition ( ) : Condition
return Condition
Example #1
0
 /**
  * Checks whether a eventConfig is appropriate to be called (subject fits, condition fits)
  *
  * @param Event $eventConfig
  * @param GenericEvent $event
  * @return bool
  */
 public function isCallable(Event $eventConfig, GenericEvent $event)
 {
     if ($eventConfig->getSubject() && $event->getSubject() != $eventConfig->getSubject()) {
         return false;
     }
     if ($eventConfig->getCondition()) {
         $args = $event->getArguments() ?: [];
         if ($eventConfig->getCondition() && !$this->conditionOperator->satisfy($eventConfig->getCondition(), $args)) {
             return false;
         }
     }
     return true;
 }