2017 © Pedro Peláez
 

library neo4j-query-builder-php

Cypher query builder for PHP

image

ents24/neo4j-query-builder-php

Cypher query builder for PHP

  • Wednesday, July 19, 2017
  • by mark-ents24
  • Repository
  • 3 Watchers
  • 1 Stars
  • 21 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Cypher Query Builder for PHP

Forked from adadgio/graph-bundle., (*1)

I needed a Cypher query builder and liked this one, but without all the Symfony and related gubbins., (*2)

Install

Install with composer:, (*3)

composer require ents24/neo4j-query-builder-php:dev-master, (*4)

Usage Examples

use Adadgio\GraphBundle\ORM\Cypher;

$cypher = (new Cypher())
    ->match('a', 'Document')
    ->match('b', 'Page')
    ->andReturn('a.id, a.name AS `a.test`, b.id, b.name')->withLabels()->withId();

// is the same as
$cypher = (new Cypher())
    ->match('a', 'Document')
    ->match('b', 'Page')
    ->andReturn('a.id, a.name AS `a.test`, b.id, b.name, labels(a), labels(b), id(a), id(b)');

// trying queries with relationships constraints (and passing string to manager instead of object)
$queryString = (new Cypher())
    ->match('a', 'Countries', array('id' => 5))
    ->newPattern()
    ->match('b', ':City:Town')
        ->relatedWith('a')
        ->by('r', 'IS_IN', array('max' => 3), '->')
    ->newPattern()
    ->match('a')
    ->getQuery();

$cypherA = (new Cypher())
    ->match('a', 'Document', array('id' => 389))
    ->set('a', array('name' => 'The good, the bad and the ugly'));

$cypherB = (new Cypher())
    ->match('a', 'Document', array('id' => 390))
    ->set('a', array('name' => 'The good, the bad and the ugly'));

The Versions

19/07 2017

dev-master

9999999-dev

Cypher query builder for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain BRUCKERT
by Mark WOOD