PAGI\Node\NodeActionCommand::whenNode PHP Method

whenNode() public method

Sets the controlled node.
public whenNode ( string $name ) : NodeActionCommand
$name string The name of the controlled node.
return NodeActionCommand
    public function whenNode($name)
    {
        $this->nodeName = $name;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Registers a new node result to be taken into account when the given node
  * is ran.
  *
  * @param string $name
  *
  * @return NodeActionCommand
  */
 public function registerResult($name)
 {
     $nodeActionCommand = new NodeActionCommand();
     if (!isset($this->nodeResults[$name])) {
         $this->nodeResults[$name] = array();
     }
     $this->nodeResults[$name][] = $nodeActionCommand;
     return $nodeActionCommand->whenNode($name);
 }