From 8889b95210e80042bc0d91509d026523527179bf Mon Sep 17 00:00:00 2001 From: Johannes Stark Date: Mon, 25 Jul 2011 16:33:46 +0200 Subject: [PATCH 1/4] getTransactionManager() moved to Workspace --- src/Jackalope/Repository.php | 2 +- src/Jackalope/Session.php | 11 +---------- src/Jackalope/Workspace.php | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/Jackalope/Repository.php b/src/Jackalope/Repository.php index ec164a8e..cce0aa41 100644 --- a/src/Jackalope/Repository.php +++ b/src/Jackalope/Repository.php @@ -81,7 +81,7 @@ public function login(CredentialsInterface $credentials = null, $workspaceName = $session = $this->factory->get('Session', array($this, $workspaceName, $credentials, $this->transport)); if ($this->transactions) { $utx = $this->factory->get('Transaction\\UserTransaction', array($this->transport, $session)); - $session->setTransactionManager($utx); + $session->getWorkspace()->setTransactionManager($utx); } return $session; diff --git a/src/Jackalope/Session.php b/src/Jackalope/Session.php index 38e0b68e..b614bc85 100644 --- a/src/Jackalope/Session.php +++ b/src/Jackalope/Session.php @@ -65,21 +65,12 @@ public function __construct($factory, Repository $repository, $workspaceName, \P $this->repository = $repository; $this->objectManager = $this->factory->get('ObjectManager', array($transport, $this)); $this->workspace = $this->factory->get('Workspace', array($this, $this->objectManager, $workspaceName)); + $this->utx = $this->workspace->getTransactionManager(); $this->credentials = $credentials; $this->namespaceRegistry = $this->workspace->getNamespaceRegistry(); self::registerSession($this); } - public function setTransactionManager(\PHPCR\Transaction\UserTransactionInterface $utx) - { - $this->utx = $utx; - } - - public function getTransactionManager() - { - return $this->utx; - } - /** * Returns the Repository object through which this session was acquired. * diff --git a/src/Jackalope/Workspace.php b/src/Jackalope/Workspace.php index ecdb4b56..064144ba 100644 --- a/src/Jackalope/Workspace.php +++ b/src/Jackalope/Workspace.php @@ -18,6 +18,7 @@ class Workspace implements \PHPCR\WorkspaceInterface protected $session; protected $nodeTypeManager; + protected $utx; protected $name; protected $namespaceRegistry; @@ -225,6 +226,28 @@ public function getQueryManager() return $this->factory->get('Query\QueryManager', array($this->session->getObjectManager())); } + /** + * Sets the TransactionManager + * + * @param \PHPCR\Transaction\UserTransactionInterface $utx A UserTransaction object + */ + public function setTransactionManager(\PHPCR\Transaction\UserTransactionInterface $utx) + { + $this->utx = $utx; + } + + /** + * Returns the TransactionManager object + * + * @return \PHPCR\Transaction\UserTransactionInterface A UserTransaction object + * @api + */ + public function getTransactionManager() + { + return $this->utx; + } + + /** * Returns the NamespaceRegistry object, which is used to access the mapping * between prefixes and namespaces. From bcb892e28480a2c25a5879338e18f722149109cd Mon Sep 17 00:00:00 2001 From: Johannes Stark Date: Mon, 25 Jul 2011 17:06:21 +0200 Subject: [PATCH 2/4] initialize utx will null --- src/Jackalope/Workspace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jackalope/Workspace.php b/src/Jackalope/Workspace.php index 064144ba..73e7f2cd 100644 --- a/src/Jackalope/Workspace.php +++ b/src/Jackalope/Workspace.php @@ -18,7 +18,7 @@ class Workspace implements \PHPCR\WorkspaceInterface protected $session; protected $nodeTypeManager; - protected $utx; + protected $utx = null; protected $name; protected $namespaceRegistry; From 9beb78073ef460d48f56aae77b9e66f2fbc69725 Mon Sep 17 00:00:00 2001 From: Johannes Stark Date: Mon, 25 Jul 2011 17:25:28 +0200 Subject: [PATCH 3/4] updating to latest phpcr --- lib/phpcr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phpcr b/lib/phpcr index ececb3b4..4a1c0fb9 160000 --- a/lib/phpcr +++ b/lib/phpcr @@ -1 +1 @@ -Subproject commit ececb3b4e0f97c14dea01aa1b684dc6e957e01b9 +Subproject commit 4a1c0fb9cdef18a04774539d180d455b91061744 From d6545d546c027b2dd1f317355c0f9bea90b72801 Mon Sep 17 00:00:00 2001 From: Johannes Stark Date: Mon, 25 Jul 2011 17:27:56 +0200 Subject: [PATCH 4/4] updating to latest phpcr-api-tests --- api-test/suite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/suite b/api-test/suite index 65aad0a4..61433c48 160000 --- a/api-test/suite +++ b/api-test/suite @@ -1 +1 @@ -Subproject commit 65aad0a48f6a8de23bc1a4f27589a5248168966a +Subproject commit 61433c489be452a7dad3e7c9d20b54dc156c53f0