Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

use base events #531

Closed
wants to merge 2 commits into from

4 participants

@docteurklein

in consequence of doctrine/common#222

@doctrinebot
Collaborator

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2187

@stof stof commented on the diff
lib/Doctrine/ORM/Event/LifecycleEventArgs.php
((14 lines not shown))
- */
- private $entity;
-
- /**
- * Constructor
- *
- * @param object $entity
- * @param \Doctrine\ORM\EntityManager $em
- */
- public function __construct($entity, EntityManager $em)
- {
- $this->entity = $entity;
- $this->em = $em;
- }
-
- /**
* Retrieve associated Entity.
*
* @return object
*/
public function getEntity()
@stof
stof added a note

this method is already defined in the Common class

Yes, I kept it, because it shouldn't be in parent class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stof stof commented on the diff
lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
@@ -29,7 +30,7 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @since 2.0
*/
-class LoadClassMetadataEventArgs extends EventArgs
+class LoadClassMetadataEventArgs extends BaseLoadClassMetadataEventArgs
@stof
stof added a note

This class should be simplified as it duplicates some code from its new parent class

My bad, I forgot to remove them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@beberlei
Owner

Merged in 8443eee

@beberlei beberlei closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2012
  1. @docteurklein

    use base events

    docteurklein authored
  2. @docteurklein
This page is out of date. Refresh to see the latest.
View
30 lib/Doctrine/ORM/Event/LifecycleEventArgs.php
@@ -19,8 +19,8 @@
namespace Doctrine\ORM\Event;
-use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager;
+use Doctrine\Common\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs;
/**
* Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
@@ -31,38 +31,16 @@
* @author Roman Borschel <roman@code-factory.de>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
-class LifecycleEventArgs extends EventArgs
+class LifecycleEventArgs extends BaseLifecycleEventArgs
{
/**
- * @var \Doctrine\ORM\EntityManager
- */
- private $em;
-
- /**
- * @var object
- */
- private $entity;
-
- /**
- * Constructor
- *
- * @param object $entity
- * @param \Doctrine\ORM\EntityManager $em
- */
- public function __construct($entity, EntityManager $em)
- {
- $this->entity = $entity;
- $this->em = $em;
- }
-
- /**
* Retrieve associated Entity.
*
* @return object
*/
public function getEntity()
@stof
stof added a note

this method is already defined in the Common class

Yes, I kept it, because it shouldn't be in parent class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
- return $this->entity;
+ return $this->getObject();
}
/**
@@ -72,6 +50,6 @@ public function getEntity()
*/
public function getEntityManager()
{
- return $this->em;
+ return $this->getObjectManager();
}
}
View
37 lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
@@ -22,6 +22,7 @@
use Doctrine\Common\EventArgs;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\EntityManager;
+use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs as BaseLoadClassMetadataEventArgs;
/**
* Class that holds event arguments for a loadMetadata event.
@@ -29,48 +30,16 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @since 2.0
*/
-class LoadClassMetadataEventArgs extends EventArgs
+class LoadClassMetadataEventArgs extends BaseLoadClassMetadataEventArgs
@stof
stof added a note

This class should be simplified as it duplicates some code from its new parent class

My bad, I forgot to remove them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
/**
- * @var \Doctrine\ORM\Mapping\ClassMetadata
- */
- private $classMetadata;
-
- /**
- * @var \Doctrine\ORM\EntityManager
- */
- private $em;
-
- /**
- * Constructor.
- *
- * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata
- * @param \Doctrine\ORM\EntityManager $em
- */
- public function __construct(ClassMetadataInfo $classMetadata, EntityManager $em)
- {
- $this->classMetadata = $classMetadata;
- $this->em = $em;
- }
-
- /**
- * Retrieve associated ClassMetadata.
- *
- * @return \Doctrine\ORM\Mapping\ClassMetadataInfo
- */
- public function getClassMetadata()
- {
- return $this->classMetadata;
- }
-
- /**
* Retrieve associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
public function getEntityManager()
{
- return $this->em;
+ return $this->getObjectManager();
}
}
2  lib/vendor/doctrine-common
@@ -1 +1 @@
-Subproject commit 30b8cea3bfe22f5eb58b5b0165f21df750aeb2e2
+Subproject commit d514e3920656921ba1148f16a4089222c58bc83a
Something went wrong with that request. Please try again.