Alterway\Component\Workflow\NodeMap::get PHP Method

get() public method

Gets a node by name.
public get ( string $name ) : Node
$name string
return Node
    public function get($name)
    {
        $name = (string) $name;
        if (!isset($this->items[$name])) {
            $this->items[$name] = new Node($name);
        }
        return $this->items[$name];
    }

Usage Example

Example #1
0
 /**
  * Adds a link to the workflow.
  *
  * @param string $src
  * @param string $dst
  * @param SpecificationInterface $spec
  *
  * @return Builder
  *
  * @throws Exception\NoStartingNodeBuilderException
  */
 public function link($src, $dst, SpecificationInterface $spec)
 {
     if (null === $this->start) {
         throw new Exception\NoStartingNodeBuilderException();
     }
     $this->nodes->get($src)->addTransition($this->nodes->get($dst), $spec);
     return $this;
 }
All Usage Examples Of Alterway\Component\Workflow\NodeMap::get