$master
$master : \Pho\Lib\Graph\NodeInterface
The node thay this edgelist belongs to
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.
$master : \Pho\Lib\Graph\NodeInterface
The node thay this edgelist belongs to
__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.
\Pho\Lib\Graph\NodeInterface | $node | The master, the owner of this EdgeList object. |
array | $data | Initial data to seed. |
delete(\Pho\Lib\Graph\ID $id)
\Pho\Lib\Graph\ID | $id |
import(array $data) : void
Imports data from given array source
array | $data | Data source. |
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 1275addIncoming(\Pho\Lib\Graph\EdgeInterface $edge) : void
Adds an incoming edge to the list.
The edge must be already initialized.
\Pho\Lib\Graph\EdgeInterface | $edge |
addOutgoing(\Pho\Lib\Graph\EdgeInterface $edge) : void
Adds an outgoing edge to the list.
The edge must be already initialized.
\Pho\Lib\Graph\EdgeInterface | $edge |
in(string $class = "") : \ArrayIterator
Returns a list of all the edges directed towards this particular node.
string | $class | The type of edge (defined in edge class) to return |
An array of EdgeInterface objects.
out(string $class = "") : \ArrayIterator
Returns a list of all the edges originating from this particular node.
string | $class | The type of edge (defined in edge class) to return |
An array of EdgeInterface objects.
all(string $class = "") : \ArrayIterator
Returns a list of all the edges (both in and out) pertaining to this particular node.
string | $class | The type of edge (defined in edge class) to return |
An array of EdgeInterface objects.
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.
\Pho\Lib\Graph\ID | $node_id | Target (head) node. |
string | $class | The type of edge (defined in edge class) to return |
An array of edge objects to. Returns an empty array if there is no such connections.
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.
\Pho\Lib\Graph\ID | $node_id | Source (tail) node. |
string | $class | The type of edge (defined in edge class) to return |
An array of edge objects from. Returns an empty array if there is no such connections.
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.
\Pho\Lib\Graph\ID | $node_id | The other node. |
string | $class | The type of edge (defined in edge class) to return |
An array of edge objects in between. Returns an empty array if there is no such connections.
retrieve(\Pho\Lib\Graph\Direction $direction, string $class) : \ArrayIterator
A helper method to retrieve edges.
\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 |
An array of EdgeInterface objects.
retrieveDirected(\Pho\Lib\Graph\Direction $direction, \Pho\Lib\Graph\ID $node_id, string $class) : \ArrayIterator
A helper method to retrieve directed edges.
\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. |
An array of EdgeInterface objects.
isDataSetProperly(array $data) : boolean
Checks if the data source for import is valid.
array | $data |