PAGI\Node\NodeActionCommand::appliesTo PHP Method

appliesTo() public method

True if the given node (already executed) matches with the specs defined in this action command.
public appliesTo ( Node $node ) : boolean
$node Node
return boolean
    public function appliesTo(Node $node)
    {
        if ($node->wasCancelled() && $this->result == self::NODE_RESULT_CANCEL) {
            return true;
        } elseif ($node->isComplete() && $this->result == self::NODE_RESULT_COMPLETE && (!isset($this->data['input']) || $this->data['input'] == $node->getInput())) {
            return true;
        } elseif ($node->maxInputsReached() && $this->result == self::NODE_RESULT_MAX_ATTEMPTS_REACHED) {
            return true;
        }
        return false;
    }