Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adjusting to use jackalope objects when using jackalope specific meth…

…ods in transport. some doc cleanup
  • Loading branch information...
commit 61cfed5f3552ead0631eddf0c7c93c172a427051 1 parent 9156fc0
@dbu dbu authored
Showing with 16 additions and 8 deletions.
  1. +16 −8 src/Jackalope/Transport/DoctrineDBAL/Client.php
View
24 src/Jackalope/Transport/DoctrineDBAL/Client.php
@@ -25,6 +25,9 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
+use Jackalope\Node;
+use Jackalope\Property;
+use Jackalope\Query\Query;
use Jackalope\Transport\BaseTransport;
use Jackalope\Transport\QueryInterface as QueryTransport;
use Jackalope\Transport\WritingInterface;
@@ -32,6 +35,7 @@
use Jackalope\Transport\NodeTypeManagementInterface;
use Jackalope\Transport\TransactionInterface;
use Jackalope\Transport\StandardNodeTypes;
+use Jackalope\Transport\DoctrineDBAL\Query\QOMWalker;
use Jackalope\NodeType\NodeTypeManager;
use Jackalope\NotImplementedException;
use Jackalope\FactoryInterface;
@@ -76,7 +80,7 @@ class Client extends BaseTransport implements QueryTransport, WritingInterface,
private $nodeIdentifiers = array();
/**
- * @var PHPCR\NodeType\NodeTypeManagerInterface
+ * @var \PHPCR\NodeType\NodeTypeManagerInterface
*/
private $nodeTypeManager;
@@ -658,7 +662,7 @@ static public function propsToXML($properties, $inlineBinaries = false)
$binaryData = null;
foreach ($properties as $property) {
- /* @var $prop \PHPCR\PropertyInterface */
+ /* @var $property Property */
$propertyNode = $dom->createElement('sv:property');
$propertyNode->setAttribute('sv:name', $property->getName());
$propertyNode->setAttribute('sv:type', PropertyType::nameFromValue($property->getType()));
@@ -725,6 +729,8 @@ static public function propsToXML($properties, $inlineBinaries = false)
case PropertyType::DOUBLE:
$values = $property->getDouble();
break;
+ default:
+ throw new RepositoryException('unknown type '.$property->getType());
}
foreach ((array)$values as $value) {
@@ -1122,14 +1128,14 @@ private function validateNode($node, $def)
}
}
- private function getResponsibleNodeTypes($node)
+ private function getResponsibleNodeTypes(Node $node)
{
// This is very slow i believe :-(
$nodeDef = $node->getPrimaryNodeType();
$nodeTypes = $node->getMixinNodeTypes();
array_unshift($nodeTypes, $nodeDef);
foreach ($nodeTypes as $nodeType) {
- /* @var $nodeType \PHPCR\NodeType\NodeTypeDefinitionInterface */
+ /* @var $nodeType \Jackalope\NodeType\NodeType */
foreach ($nodeType->getDeclaredSupertypes() as $superType) {
$nodeTypes[] = $superType;
}
@@ -1141,7 +1147,7 @@ private function getResponsibleNodeTypes($node)
/**
* {@inheritDoc}
*/
- public function storeNode(\PHPCR\NodeInterface $node)
+ public function storeNode(Node $node)
{
$this->assertLoggedIn();
@@ -1177,7 +1183,7 @@ public function storeNode(\PHPCR\NodeInterface $node)
/**
* {@inheritDoc}
*/
- public function storeProperty(\PHPCR\PropertyInterface $property)
+ public function storeProperty(Property $property)
{
$this->assertLoggedIn();
@@ -1191,7 +1197,9 @@ public function storeProperty(\PHPCR\PropertyInterface $property)
* Validation if all the data is correct before writing it into the database.
*
* @param \PHPCR\PropertyInterface $property
+ *
* @throws \PHPCR\ValueFormatException
+ *
* @return void
*/
private function assertValidProperty($property)
@@ -1481,7 +1489,7 @@ public function getProperty($path)
/**
* {@inheritDoc}
*/
- public function query(\PHPCR\Query\QueryInterface $query)
+ public function query(Query $query)
{
$this->assertLoggedIn();
@@ -1516,7 +1524,7 @@ public function query(\PHPCR\Query\QueryInterface $query)
throw new InvalidQueryException($msg);
}
- $qomWalker = new Query\QOMWalker($this->nodeTypeManager, $this->conn->getDatabasePlatform(), $this->getNamespaces());
+ $qomWalker = new QOMWalker($this->nodeTypeManager, $this->conn->getDatabasePlatform(), $this->getNamespaces());
$sql = $qomWalker->walkQOMQuery($query);
$sql = $this->conn->getDatabasePlatform()->modifyLimitQuery($sql, $limit, $offset);
Please sign in to comment.
Something went wrong with that request. Please try again.