Doctrine\Common\DataFixtures\Sorter\TopologicalSorter::addNode PHP Method

addNode() public method

Adds a new node (vertex) to the graph, assigning its hash and value.
public addNode ( string $hash, Doctrine\ORM\Mapping\ClassMetadata $node ) : void
$hash string
$node Doctrine\ORM\Mapping\ClassMetadata
return void
    public function addNode($hash, ClassMetadata $node)
    {
        $this->nodeList[$hash] = new Vertex($node);
    }

Usage Example

 public function testFailureSortMissingDependency()
 {
     $node1 = new Mock\Node(1);
     $this->sorter->addNode('1', $node1);
     $this->sorter->addDependency('1', '2');
     $this->expectException(\RuntimeException::class);
     $this->sorter->sort();
 }
All Usage Examples Of Doctrine\Common\DataFixtures\Sorter\TopologicalSorter::addNode