Skip to content

neo4j-php/php-cypher-dsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ac5a3f2 · Jan 7, 2024
Feb 6, 2023
May 3, 2023
May 3, 2023
Aug 12, 2022
Dec 5, 2022
Nov 26, 2022
Sep 19, 2023
Dec 8, 2022
Sep 19, 2023
Jan 7, 2024
Jan 30, 2023
Sep 19, 2023
Aug 12, 2022
Nov 18, 2022
Nov 25, 2022

Repository files navigation

php-cypher-dsl

The php-cypher-dsl library provides a way to construct advanced Cypher queries in an object-oriented and type-safe manner.

Documentation

The documentation can be found on the wiki here.

Installation

Requirements

php-cypher-dsl requires PHP 7.4 or greater; using the latest version of PHP is highly recommended.

Installation through Composer

You can install php-cypher-dsl through composer by running the following command:

composer require "wikibase-solutions/php-cypher-dsl"

Contributing

Please refer to CONTRIBUTING.md for information on how to contribute to this project.

Example

To construct a query to find all of Tom Hanks' co-actors, you can use the following code:

use function WikibaseSolutions\CypherDSL\node;
use function WikibaseSolutions\CypherDSL\query;

$tom = node("Person")->withProperties(["name" => "Tom Hanks"]);
$coActors = node();

$statement = query()
    ->match($tom->relationshipTo(Query::node(), "ACTED_IN")->relationshipFrom($coActors, "ACTED_IN"))
    ->returning($coActors->property("name"))
    ->build();