Skip to content

Commit 0570897

Browse files
committed
Merge pull request #120 from phpcr/date_querying
Date querying
2 parents 2aeb5e1 + 5bda345 commit 0570897

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/06_Query/QOM/QomTestQueries.php

+11
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,17 @@ public static function getQueries(\PHPCR\Query\QOM\QueryObjectModelFactoryInterf
402402
array(),
403403
array());
404404

405+
// SELECT * FROM nt:unstructured WHERE sel.prop > '2013-04-15'
406+
$queries['6.7.27.1.PropertyValue'] =
407+
$factory->createQuery(
408+
$factory->selector('sel', 'nt:unstructured'),
409+
$factory->comparison(
410+
$factory->propertyValue('sel', 'prop'),
411+
Constants::JCR_OPERATOR_GREATER_THAN,
412+
$factory->literal(new \DateTime('2013-04-15 +02:00'))),
413+
array(),
414+
array());
415+
405416
/**
406417
* 6.7.28. Length
407418
*/

tests/06_Query/QOM/Sql2TestQueries.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ public static function getQueries()
144144
);
145145

146146
/**
147-
* 6.7.27. ProperyValue
147+
* 6.7.27. PropertyValue
148148
*/
149149
$queries['6.7.27.PropertyValue'] = 'SELECT * FROM [nt:file] AS file WHERE file.prop LIKE \'literal\'';
150+
$queries['6.7.27.1.PropertyValue'] = 'SELECT * FROM [nt:unstructured] AS sel WHERE sel.prop > CAST(\'2013-04-15T00:00:00.000+02:00\' AS DATE)';
150151

151152
/**
152153
* 6.7.28. Length

0 commit comments

Comments
 (0)