PHP code example of autoprotect-group / neo4j-common
1. Go to this page and download the library: Download autoprotect-group/neo4j-common library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
autoprotect-group / neo4j-common example snippets
use GraphAware\Common\Graph\Label;
$label = new Label("User");
echo $label->getName(); // Returns (string) "User"
// or static construction
$label = Label::label("User");
use GraphAware\Common\Graph\Node;
$node = new Node(1, array("User", "Person"));
$node->getId(); // Returns (int) 1
$node->getLabels(); // Returns an array of \GraphAware\Common\Graph\Label objects
use GraphAware\Common\Graph\Relationship;
$rel = new Relationship(1, RelationshipType::withName("RELATES"), $node, $node2);
echo $rel->getType(); // Returns (string) "RELATES"
var_dump($rel->isType(RelationshipType::withName("RELATES"))); // Returns (bool) true
use GraphAware\Common\Graph\Direction;
$direction = new Direction(Direction::INCOMING);
echo $direction; // Returns (string) "INCOMING"
// Or static call construction
$direction = Direction::OUTGOING;
echo $direction; // Returns (string) "OUTGOING"