Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
Do not call execute()
Browse files Browse the repository at this point in the history
The doc is incorrect because calling ->execute() results into a QueryResult object.  This causes $qb->getQuery() failing to work because it's expecting a query builder instance
  • Loading branch information
inspiran committed Jan 5, 2013
1 parent 6cf4e63 commit 0803c41
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions en/reference/query-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ This query is equivalent to the JCR-SQL2 query ``SELECT * FROM nt:unstructured W
/** @var $qb QueryBuilder */
$factory = $qb->getQOMFactory();
$qb->from($factory->selector('nt:unstructured'))
->where($factory->propertyExistence('name'))
->execute();
->where($factory->propertyExistence('name'));
$result = $documentManager->getDocumentsByQuery($qb->getQuery());
foreach ($result as $document) {
Expand Down Expand Up @@ -90,4 +89,4 @@ If you want to know the SQL2 statement generated call getStatement() on the quer
<?php
//Prepare the query builder with the desired statement.
//..
echo $qb->getQuery()->getStatement();
echo $qb->getQuery()->getStatement();

0 comments on commit 0803c41

Please sign in to comment.