Skip to content
This repository
Browse code

properly report when we try to do the unsupported join query until #15

…is done. fix #55
  • Loading branch information...
commit fd2322c3ed446eb66c2c514b38b4fa608c5dd641 1 parent 573bfd4
David Buchmann authored September 24, 2012
2  composer.json
@@ -14,7 +14,7 @@
14 14
     ],
15 15
     "require": {
16 16
         "php": ">=5.3.2",
17  
-        "phpcr/phpcr": ">=2.1.0-beta3",
  17
+        "phpcr/phpcr": ">=2.1.0-beta6",
18 18
         "jackalope/jackalope": "1.0.*",
19 19
         "doctrine/dbal": ">=2.2.0,<2.4"
20 20
     },
18  src/Jackalope/Transport/DoctrineDBAL/Client.php
@@ -4,6 +4,7 @@
4 4
 
5 5
 use PHPCR\PropertyType;
6 6
 use PHPCR\Query\QOM\QueryObjectModelInterface;
  7
+use PHPCR\Query\QOM\SelectorInterface;
7 8
 use PHPCR\Query\QueryInterface;
8 9
 use PHPCR\RepositoryException;
9 10
 use PHPCR\NamespaceException;
@@ -324,7 +325,7 @@ public function getRepositoryDescriptors()
324 325
             RepositoryInterface::NODE_TYPE_MANAGEMENT_PROPERTY_TYPES => true,
325 326
             RepositoryInterface::NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED => false,
326 327
             RepositoryInterface::NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED => false,
327  
-            RepositoryInterface::NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED => false,
  328
+            RepositoryInterface::NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPPORTED => false,
328 329
             RepositoryInterface::NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED => false,
329 330
             RepositoryInterface::OPTION_ACCESS_CONTROL_SUPPORTED => false,
330 331
             RepositoryInterface::OPTION_ACTIVITIES_SUPPORTED => false,
@@ -1137,7 +1138,7 @@ public function moveNode($srcAbsPath, $dstAbsPath)
1137 1138
                 $values[':parent' . $i] = dirname($values[':path' . $i]);
1138 1139
 
1139 1140
                 $updatePathCase   .= "WHEN id = :id" . $i . " THEN :path" . $i . " ";
1140  
-                $updateParentCase .= "WHEN id = :id" . $i . " THEN :parent" . $i . " "; 
  1141
+                $updateParentCase .= "WHEN id = :id" . $i . " THEN :parent" . $i . " ";
1141 1142
 
1142 1143
                 if ($srcAbsPath === $row['path']) {
1143 1144
                     $values[':localname' . $i] = basename($values[':path' . $i]);
@@ -1156,7 +1157,7 @@ public function moveNode($srcAbsPath, $dstAbsPath)
1156 1157
             $updateLocalNameCase .= "ELSE local_name END, ";
1157 1158
             $updateSortOrderCase .= "ELSE sort_order END ";
1158 1159
 
1159  
-            $query .= $updatePathCase . "END, " . $updateParentCase . "END, " . $updateLocalNameCase . $updateSortOrderCase; 
  1160
+            $query .= $updatePathCase . "END, " . $updateParentCase . "END, " . $updateLocalNameCase . $updateSortOrderCase;
1160 1161
             $query .= "WHERE id IN (" . $ids . ")";
1161 1162
 
1162 1163
             $this->conn->executeUpdate($query, $values);
@@ -1749,6 +1750,12 @@ public function query(Query $query)
1749 1750
         }
1750 1751
 
1751 1752
         $source   = $query->getSource();
  1753
+
  1754
+        if (!($source instanceof SelectorInterface)) {
  1755
+            throw new NotImplementedException("Only Selector Sources are supported for now, but no Join.");
  1756
+        }
  1757
+
  1758
+        // TODO: this check is only relevant for Selector, not for Join. should we push it into the walker?
1752 1759
         $nodeType = $source->getNodeTypeName();
1753 1760
 
1754 1761
         if (!$this->nodeTypeManager->hasNodeType($nodeType)) {
@@ -1769,10 +1776,13 @@ public function query(Query $query)
1769 1776
 
1770 1777
         // The list of columns is required to filter each records props
1771 1778
         $columns = array();
1772  
-        foreach ($query->getColumns() AS $column) {
  1779
+        /** @var $column \PHPCR\Query\QOM\ColumnInterface */
  1780
+        foreach ($query->getColumns() as $column) {
1773 1781
             $columns[$column->getPropertyName()] = $column->getSelectorName();
1774 1782
         }
1775 1783
 
  1784
+        // TODO: this needs update once we implement join
  1785
+
1776 1786
         $selector = $source->getSelectorName();
1777 1787
         if (null === $selector) {
1778 1788
             $selector = $source->getNodeTypeName();

0 notes on commit fd2322c

Please sign in to comment.
Something went wrong with that request. Please try again.