\Pho\Lib\GraphEdgeList

Holds the relationship between nodes and edges.

EdgeList objects are attached to all Node objects, they are created at object initialization. They contain edge objects categorized by their direction.

Summary

Methods
Properties
Constants
__construct()
delete()
import()
toArray()
addIncoming()
addOutgoing()
in()
out()
all()
to()
from()
between()
No public properties found
No constants found
retrieve()
retrieveDirected()
No protected properties found
N/A
isDataSetProperly()
$master
$out
$in
$from
$to
N/A

Properties

$out

$out : array

An internal pointer of outgoing nodes in [ID=>EncapsulatedEdge] format where ID belongs to the edge.

Type

array

$in

$in : array

An internal pointer of incoming nodes in [ID=>EncapsulatedEdge] format where ID belongs to the edge

Type

array

$from

$from : array

An internal pointer of incoming nodes in [ID=>[ID=>EncapsulatedEdge]] format where first ID belongs to the node, and second to the edge.

Type

array

$to

$to : array

An internal pointer of outgoing nodes in [ID=>[ID=>EncapsulatedEdge]] format where first ID belongs to the node, and second to the edge.

Type

array

Methods

__construct()

__construct(\Pho\Lib\Graph\NodeInterface  $node, array  $data = array()) 

Constructor

For performance reasons, the constructor doesn't load the seed data (if available) but waits for a method to attempt to access.

Parameters

\Pho\Lib\Graph\NodeInterface $node

The master, the owner of this EdgeList object.

array $data

Initial data to seed.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

delete()

delete(\Pho\Lib\Graph\ID  $id) 

Parameters

\Pho\Lib\Graph\ID $id
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

import()

import(array  $data) : void

Imports data from given array source

Parameters

array $data

Data source.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

toArray()

toArray() : array

Retrieves this object in array format

With all "in" and "out" values in simple string format. The "to" array can be reconstructed.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

array

addIncoming()

addIncoming(\Pho\Lib\Graph\EdgeInterface  $edge) : void

Adds an incoming edge to the list.

The edge must be already initialized.

Parameters

\Pho\Lib\Graph\EdgeInterface $edge
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

addOutgoing()

addOutgoing(\Pho\Lib\Graph\EdgeInterface  $edge) : void

Adds an outgoing edge to the list.

The edge must be already initialized.

Parameters

\Pho\Lib\Graph\EdgeInterface $edge
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

in()

in(string  $class = "") : \ArrayIterator

Returns a list of all the edges directed towards this particular node.

Parameters

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of EdgeInterface objects.

out()

out(string  $class = "") : \ArrayIterator

Returns a list of all the edges originating from this particular node.

Parameters

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of EdgeInterface objects.

all()

all(string  $class = "") : \ArrayIterator

Returns a list of all the edges (both in and out) pertaining to this particular node.

Parameters

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of EdgeInterface objects.

to()

to(\Pho\Lib\Graph\ID  $node_id, string  $class = "") : \ArrayIterator

Retrieves a list of edges from the list's owner node to the given target node.

Parameters

\Pho\Lib\Graph\ID $node_id

Target (head) node.

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of edge objects to. Returns an empty array if there is no such connections.

from()

from(\Pho\Lib\Graph\ID  $node_id, string  $class = "") : \ArrayIterator

Retrieves a list of edges to the list's owner node from the given source node.

Parameters

\Pho\Lib\Graph\ID $node_id

Source (tail) node.

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of edge objects from. Returns an empty array if there is no such connections.

between()

between(\Pho\Lib\Graph\ID  $node_id, string  $class = "") : \ArrayIterator

Retrieves a list of edges between the list's owner node and the given node.

Parameters

\Pho\Lib\Graph\ID $node_id

The other node.

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of edge objects in between. Returns an empty array if there is no such connections.

retrieve()

retrieve(\Pho\Lib\Graph\Direction  $direction, string  $class) : \ArrayIterator

A helper method to retrieve edges.

Parameters

\Pho\Lib\Graph\Direction $direction

Lets you choose to fetch incoming or outgoing edges.

string $class

The type of edge (defined in edge class) to return

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of EdgeInterface objects.

retrieveDirected()

retrieveDirected(\Pho\Lib\Graph\Direction  $direction, \Pho\Lib\Graph\ID  $node_id, string  $class) : \ArrayIterator

A helper method to retrieve directed edges.

Parameters

\Pho\Lib\Graph\Direction $direction

Lets you choose to fetch incoming or outgoing edges.

\Pho\Lib\Graph\ID $node_id

Directed towards which node.

string $class

The type of edge (defined in edge class) to return.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\ArrayIterator —

An array of EdgeInterface objects.

isDataSetProperly()

isDataSetProperly(array  $data) : boolean

Checks if the data source for import is valid.

Parameters

array $data
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

boolean