PHP code example of paulmozo / php-cypher-query-builder

1. Go to this page and download the library: Download paulmozo/php-cypher-query-builder 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/ */

    

paulmozo / php-cypher-query-builder example snippets


$client = new Moozla\QueryBuilder\Client();

$client
  ->match('Person', 'person')
  ->match('LIKES')
  ->match('Movie', 'movie')
  ->where('movie', 'name', "=", 'Taxi Driver')
  ->return('movie');

echo (string)$client;

$client = new Moozla\QueryBuilder\Client();

$client
  ->match('Person', 'person')
  ->match('LIKES', 'likes')
  ->match('Movie', 'movie')
  ->return('person')
  ->return('likes')
  ->return('movie');

echo (string)$client;

$client = new Moozla\QueryBuilder\Client();

$client
  ->match('Person', 'person')
  ->appendToMatch('-[]->(:CustomMatch)')
  ->appendToWhere('(person)-[:KNOWS]-({name: 'Jeff'})')
  ->appendToReturn('count(person)');

echo (string)$client;

$client = new Moozla\QueryBuilder\Client();
$client
  ->match('Person', 'person')
  ->endMatch()
  ->match('Movie', 'movie')
  ->match('DIRECTED_BY')
  ->match('Director', 'director')
  ->where('director', 'name', '=', 'Ms Director')
  ->return('movie')
  ->return('person');
      
echo (string)$client;