go1/edge

This package's canonical repository appears to be gone and the package has been frozen as a result.

Maintainers

Details

github.com/go1com/edge

Source

Installs: 24 679

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 7

Forks: 0

v0.3 2016-04-05 11:23 UTC

This package is auto-updated.

Last update: 2024-10-14 02:23:48 UTC


README

Simple relationship controller.

# Create the edge
$edge = new Edge($connection, 'edge', $type = 111);

# Instance if the database schema is not yet configured
$edge->install();

# Create connection from source to target
$edge->link(333, 555);
$edge->link(555, 333);
$edge->link(555, 999);
$edge->link(999, 555);

# Get connections
$edge->getTargetIds(555);        # = [333, 999]
$edge->getTargetIds([333, 555]); # = [333 => array(555), 555 => array(333, 999)]
$edge->getSourceIds(999);        # = [555]
$edge->getSourceIds([333, 999]); # = [333 => array(555), 999 => array(555)]

# Remove connection by source
$edge->clearUsingSource(555);

# Remove connection by target
$edge->clearUsingTarget(999);