kernel/private/classes/ezptopologicalsort.php

Show: inherited
Table of Contents

File containing the ezpTopologicalSort class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Package
kernel  
Version
4.6.0  

\ezpTopologicalSort

Package: Default

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

Properties

Propertyprotected  $nodes= 'array()'
Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( array $dependencies = array() ) : void

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
Name Type Description
$dependencies array

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

methodprivategetRootNodes( ) : array

Returns a list of node objects that do not have parents.

Returns
Type Description
array of node objects
methodpublicsort( ) : \sorted

Performs the topological linear ordering.

Returns
Type Description
\sorted array
Documentation was generated by DocBlox 0.18.1.