From 1c1729f5b57d4c75f5c3ec8109a887663a71a6d5 Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Tue, 17 Apr 2018 15:19:44 +0200 Subject: [PATCH 1/7] update odm module --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6727aad..46eafea 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zf-commons/zfc-user": "0.*", - "doctrine/doctrine-mongo-odm-module": "~0.9.1" + "doctrine/doctrine-mongo-odm-module": "~1.0" }, "minimum-stability": "dev", "extra": { From 58661f41d12789bc111694737932c276f2023511 Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Tue, 17 Apr 2018 15:45:55 +0200 Subject: [PATCH 2/7] Update composer.json update latest ZFCUser --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46eafea..bea486d 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "require": { "php": ">=5.3.3", - "zf-commons/zfc-user": "0.*", + "zf-commons/zfc-user": "3.*", "doctrine/doctrine-mongo-odm-module": "~1.0" }, "minimum-stability": "dev", From 3ae2495147d58bf8746643685c78d6b232b64255 Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Tue, 17 Apr 2018 16:29:01 +0200 Subject: [PATCH 3/7] Update Module.php remove obsolete method call --- Module.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Module.php b/Module.php index 4a5a57a..d439408 100644 --- a/Module.php +++ b/Module.php @@ -13,11 +13,6 @@ public function onBootstrap($e) $sm = $app->getServiceManager(); $options = $sm->get('zfcuser_module_options'); - // Add the default entity driver only if specified in configuration - if ($options->getEnableDefaultEntities()) { - $chain = $sm->get('doctrine.driver.odm_default'); - $chain->addDriver(new XmlDriver(__DIR__ . '/config/xml'), 'ZfcUserDoctrineMongoODM\Document'); - } } public function getAutoloaderConfig() From fe78e93347c9d1c1c615f5acc6136d10b5367758 Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Tue, 17 Apr 2018 16:44:24 +0200 Subject: [PATCH 4/7] Update UserMongoDB.php update methods as per updated zfcuser interfaces --- src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php b/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php index c901be5..c913274 100644 --- a/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php +++ b/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php @@ -71,13 +71,13 @@ public function persist($document) $dm->flush(); } - public function insert($document, $tableName = null, HydratorInterface $hydrator = null) + public function insert(\ZfcUser\Entity\UserInterface $user) { $this->dm->persist($document); $this->dm->flush(); } - public function update($document, $where = null, $tableName = null, HydratorInterface $hydrator = null) + public function update(\ZfcUser\Entity\UserInterface $user) { if (!$where) { $where = 'id = ' . $document->getId(); From 93675c5da92a7195acd0ea2205f6a9f58e538c7f Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Tue, 17 Apr 2018 22:59:04 +0200 Subject: [PATCH 5/7] Update UserMongoDB.php update method logic as per zfcuser updates --- src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php b/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php index c913274..cd321b7 100644 --- a/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php +++ b/src/ZfcUserDoctrineMongoODM/Mapper/UserMongoDB.php @@ -73,17 +73,15 @@ public function persist($document) public function insert(\ZfcUser\Entity\UserInterface $user) { - $this->dm->persist($document); + $this->dm->persist($user); $this->dm->flush(); } public function update(\ZfcUser\Entity\UserInterface $user) { - if (!$where) { - $where = 'id = ' . $document->getId(); - } + - $this->dm->persist($document); + $this->dm->persist($user); $this->dm->flush(); } } From 5ea22eebce7f448e9b68a02180c5e8a7f0fb923e Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Fri, 11 May 2018 09:14:58 +0200 Subject: [PATCH 6/7] fix incorrect fieldName The field name in ZFCUser is in camel case. Whereas, here it is underscored. This is causing errors when running DoctrineModule command line such as odm:schema:create --- ...UserDoctrineMongoODM.Document.UserMappedSuperClass.dcm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/xml/ZfcUserDoctrineMongoODM.Document.UserMappedSuperClass.dcm.xml b/config/xml/ZfcUserDoctrineMongoODM.Document.UserMappedSuperClass.dcm.xml index 26a847a..7e3d7d3 100644 --- a/config/xml/ZfcUserDoctrineMongoODM.Document.UserMappedSuperClass.dcm.xml +++ b/config/xml/ZfcUserDoctrineMongoODM.Document.UserMappedSuperClass.dcm.xml @@ -10,9 +10,9 @@ - + - \ No newline at end of file + From 583ea9ccea0681cf30c705bd193a84bcfa5cc1fb Mon Sep 17 00:00:00 2001 From: Mat Wright Date: Fri, 11 May 2018 10:09:44 +0200 Subject: [PATCH 7/7] Update version of mongo odm module --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bea486d..ffa1aa8 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zf-commons/zfc-user": "3.*", - "doctrine/doctrine-mongo-odm-module": "~1.0" + "doctrine/doctrine-mongo-odm-module": "^1.0" }, "minimum-stability": "dev", "extra": {