From 4efaa2c3dc9474ed813c22d3238ea09af404456d Mon Sep 17 00:00:00 2001 From: alexptrn Date: Mon, 10 Mar 2014 23:47:53 +0100 Subject: [PATCH 1/2] add missing parameter $selectorName --- tutorial/Tutorial.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial/Tutorial.md b/tutorial/Tutorial.md index 0219ccf..c6d18c7 100644 --- a/tutorial/Tutorial.md +++ b/tutorial/Tutorial.md @@ -370,7 +370,7 @@ The QOM factory has a method to build a QOM query given four parameters, and [pr The simplest case is to select all `[nt:unstructured]` nodes: - $source = $qomFactory->selector('[nt:unstructured]'); + $source = $qomFactory->selector('node', '[nt:unstructured]'); $query = $qomFactory->createQuery($source, null, array(), array()); $queryResult = $query->execute(); @@ -388,13 +388,13 @@ An example of query built with QueryBuilder: $qf = $qomFactory; $qb = new QueryBuilder($qomFactory); //add the source - $qb->from($qomFactory->selector('nt:unstructured')) + $qb->from($qomFactory->selector('node', 'nt:unstructured')) //some composed constraint - ->andWhere($qf->comparison($qf->propertyValue('title'), + ->andWhere($qf->comparison($qf->propertyValue('node', 'title'), QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO, $qf->literal('Test'))) //orderings (descending by default) - ->orderBy($qf->propertyValue('content')) + ->orderBy($qf->propertyValue('node', 'content')) //set an offset ->setFirstResult(0) //and the maximum number of node-tuples to retrieve From 801c4b526199e28a8827d28d7beb56258c6d2984 Mon Sep 17 00:00:00 2001 From: Alessandro Paterno Date: Tue, 11 Mar 2014 09:46:21 +0100 Subject: [PATCH 2/2] add alias for $selectorName parameter --- tutorial/Tutorial.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial/Tutorial.md b/tutorial/Tutorial.md index c6d18c7..accecfb 100644 --- a/tutorial/Tutorial.md +++ b/tutorial/Tutorial.md @@ -370,7 +370,7 @@ The QOM factory has a method to build a QOM query given four parameters, and [pr The simplest case is to select all `[nt:unstructured]` nodes: - $source = $qomFactory->selector('node', '[nt:unstructured]'); + $source = $qomFactory->selector('a', '[nt:unstructured]'); $query = $qomFactory->createQuery($source, null, array(), array()); $queryResult = $query->execute(); @@ -388,13 +388,13 @@ An example of query built with QueryBuilder: $qf = $qomFactory; $qb = new QueryBuilder($qomFactory); //add the source - $qb->from($qomFactory->selector('node', 'nt:unstructured')) + $qb->from($qomFactory->selector('a', 'nt:unstructured')) //some composed constraint - ->andWhere($qf->comparison($qf->propertyValue('node', 'title'), + ->andWhere($qf->comparison($qf->propertyValue('a', 'title'), QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO, $qf->literal('Test'))) //orderings (descending by default) - ->orderBy($qf->propertyValue('node', 'content')) + ->orderBy($qf->propertyValue('a', 'content')) //set an offset ->setFirstResult(0) //and the maximum number of node-tuples to retrieve