Neoxygen\NeoClient\Formatter\Result::getNodesByLabel PHP Method

getNodesByLabel() public method

Returns all nodes with the given label.
public getNodesByLabel ( string $name, boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[]
$name string
$labelizedKeys boolean When true, the results are indexed by node label. Assumes only one node per label.
return Neoxygen\NeoClient\Formatter\Node[]
    public function getNodesByLabel($name, $labelizedKeys = false)
    {
        $collection = array();
        foreach ($this->getNodes() as $node) {
            if ($node->hasLabel($name)) {
                if ($labelizedKeys) {
                    $collection[$name] = $node;
                } else {
                    $collection[] = $node;
                }
            }
        }
        return $collection;
    }