eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpTopologicalSort

class ezpTopologicalSort

Sorts a series of dependencies in linear order (topological sort).

Methods

__construct(array $dependencies = array())

Create a topological sort.

sorted sort()

Performs the topological linear ordering.

Details

at line 36
public __construct(array $dependencies = array())

Create a topological sort.

null, // a has no dependencies 'b' => 'a', // b depends on a 'd' => 'b', // d depends on b 'e' => array( 'd', 'c' ) // e depends on d and c ) ); ?>

Parameters

array $dependencies Array of dependencies where the keys depends on the values. Values can either be a scalar or an array.

at line 55
public sorted sort()

Performs the topological linear ordering.

Return Value

sorted array