Permalink
Browse files

remove obsolete method, added a todo

  • Loading branch information...
1 parent f7c1caf commit 354461d16b5d214acfcd19fe61fd78d7cc359e76 @dbu dbu committed Jan 18, 2013
Showing with 10 additions and 12 deletions.
  1. +7 −0 CHANGELOG.md
  2. +3 −12 lib/Doctrine/ODM/PHPCR/DocumentRepository.php
View
@@ -1,6 +1,13 @@
Changelog
=========
+2013-01-18
+----------
+
+ * Removed DocumentRepository->getDocumentsByQuery as it is no longer needed.
+ createQuery returns you an ODM query that can find documents directly.
+ To get documents from a PHPCR query there is DocumentManager->getDocumentsByPhpcrQuery()
+
2013-01-13
----------
@@ -240,10 +240,12 @@ public function escapeFullText($string)
* @param string $statement the SQL2 statement
* @param string $language (see QueryInterface for list of supported types)
* @param bool $replaceWithFieldnames if * should be replaced with Fieldnames automatically
- * @return PHPCR\Query\QueryResultInterface
+ *
+ * @return Query
*/
public function createQuery($statement, $language, $options = 0)
{
+ // TODO: refactor this to use the odm query builder
@dbu
dbu Jan 18, 2013 Member

@dantleech if you could do this, would be awesome!

@dantleech
dantleech Jan 18, 2013 Contributor

Yeah, I think this is one of those things that we will get for free if we carry on evolving the ODM. e.g. if we implement DQL, that would be accepted here and this use case would be pushed down to the PHPCR level.

$qb = $this->dm->createPhpcrQueryBuilder()->setFromQuery($statement, $language);
if ($options & self::QUERY_REPLACE_WITH_FIELDNAMES) {
$columns = $qb->getColumns();
@@ -270,17 +272,6 @@ public function createQuery($statement, $language, $options = 0)
}
/**
- * Get documents from a PHPCR query instance
- *
- * @param \PHPCR\Query\QueryResultInterface $result
- * @return array of document instances
- */
- public function getDocumentsByQuery(\PHPCR\Query\QueryInterface $query)
- {
- return $this->dm->getDocumentsByQuery($query, $this->className);
- }
-
- /**
* Create a QueryBuilder that is prepopulated for this repositories document
*
* The returned query builder will be prepopulated with the criteria

0 comments on commit 354461d

Please sign in to comment.