diff --git a/Module.php b/Module.php index 86356ba..cc813d2 100644 --- a/Module.php +++ b/Module.php @@ -16,7 +16,7 @@ public function onBootstrap($e) // Add the default entity driver only if specified in configuration if ($options->getEnableDefaultEntities()) { $chain = $sm->get('doctrine.driver.orm_default'); - $chain->addDriver(new XmlDriver(__DIR__ . '/config/xml/zfcuserdoctrineorm'), 'ZfcUserDoctrineORM\Entity'); + $chain->addDriver(new XmlDriver(__DIR__ . '/config/xml/goalioforgotpassworddoctrineorm'), 'GoalioForgotPasswordDoctrineORM\Entity'); } } @@ -44,7 +44,7 @@ public function getServiceConfig() return new Options\ModuleOptions(isset($config['goalioforgotpassword']) ? $config['goalioforgotpassword'] : array()); }, 'goalioforgotpassword_password_mapper' => function ($sm) { - return new \GoalioForgotPasswordDoctrineORM\Mapper\User( + return new \GoalioForgotPasswordDoctrineORM\Mapper\Password( $sm->get('goalioforgotpassword_doctrine_em'), $sm->get('goalioforgotpassword_module_options') ); diff --git a/config/module.config.php b/config/module.config.php index e1a79d0..0c8d32d 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -9,7 +9,7 @@ 'orm_default' => array( 'drivers' => array( - 'GoalioForgotPasswordDoctrineORM\Entity' => 'goalioforgotpassword_entity' + 'GoalioForgotPassword\Entity' => 'goalioforgotpassword_entity' ) ) ) diff --git a/config/xml/goalioforgotpassword/GoalioForgotPassword.Entity.Password.dcm.xml b/config/xml/goalioforgotpassword/GoalioForgotPassword.Entity.Password.dcm.xml index 0f728a4..e24de3f 100644 --- a/config/xml/goalioforgotpassword/GoalioForgotPassword.Entity.Password.dcm.xml +++ b/config/xml/goalioforgotpassword/GoalioForgotPassword.Entity.Password.dcm.xml @@ -7,9 +7,9 @@ - - - + + + diff --git a/config/xml/goalioforgotpassworddoctrineorm/GoalioForgotPasswordDoctrineORM.Entity.Password.dcm.xml b/config/xml/goalioforgotpassworddoctrineorm/GoalioForgotPasswordDoctrineORM.Entity.Password.dcm.xml index 068df1c..1dc1ebc 100644 --- a/config/xml/goalioforgotpassworddoctrineorm/GoalioForgotPasswordDoctrineORM.Entity.Password.dcm.xml +++ b/config/xml/goalioforgotpassworddoctrineorm/GoalioForgotPasswordDoctrineORM.Entity.Password.dcm.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/src/GoalioForgotPasswordDoctrineORM/Mapper/Password.php b/src/GoalioForgotPasswordDoctrineORM/Mapper/Password.php index 0236175..21eb31a 100644 --- a/src/GoalioForgotPasswordDoctrineORM/Mapper/Password.php +++ b/src/GoalioForgotPasswordDoctrineORM/Mapper/Password.php @@ -35,13 +35,13 @@ public function findByUser($userId) { $er = $this->em->getRepository($this->options->getPasswordEntityClass()); - return $er->findOneBy(array('user' => $userId)); + return $er->findOneBy(array('user_id' => $userId)); } public function findByUserIdRequestKey($userId, $key) { $er = $this->em->getRepository($this->options->getPasswordEntityClass()); - return $er->findOneBy(array('user' => $userId, 'requestKey' => $key)); + return $er->findOneBy(array('user_id' => $userId, 'requestKey' => $key)); } public function cleanExpiredForgotRequests($expiryTime=86400) @@ -51,7 +51,7 @@ public function cleanExpiredForgotRequests($expiryTime=86400) public function cleanPriorForgotRequests($userId) { - $dql = sprintf("DELETE %s u WHERE u.user = %s", $this->options->getPasswordEntityClass(), $userId); + $dql = sprintf("DELETE %s u WHERE u.user_id = %s", $this->options->getPasswordEntityClass(), $userId); $query = $this->em->createQuery($dql); $query->getResult(); }