Permalink
Browse files

Do not call execute()

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...
1 parent 6cf4e63 commit 0803c41e05fdfee06bfe05e44968a2bcff94adde @inspiran inspiran committed Jan 5, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 en/reference/query-builder.rst
@@ -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) {
@@ -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.