GraphAware\Neo4j\Client\HttpDriver\Pipeline::statements PHP Method

statements() public method

public statements ( ) : GraphAware\Common\Cypher\Statement[]
return GraphAware\Common\Cypher\Statement[]
    public function statements()
    {
        return $this->statements;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param Pipeline $pipeline
  *
  * @return Request
  */
 public function prepareRequest(Pipeline $pipeline)
 {
     $statements = [];
     foreach ($pipeline->statements() as $statement) {
         $st = ['statement' => $statement->text(), 'resultDataContents' => ['REST', 'GRAPH'], 'includeStats' => true];
         if (!empty($statement->parameters())) {
             $st['parameters'] = $this->formatParams($statement->parameters());
         }
         $statements[] = $st;
     }
     $body = json_encode(['statements' => $statements]);
     $headers = [['X-Stream' => true, 'Content-Type' => 'application/json']];
     return new Request('POST', sprintf('%s/db/data/transaction/commit', $this->uri), $headers, $body);
 }