doctrine/doctrine2 — pull request #902 by gwagner (2014-01-08 23:23:29+00:00)
Title: Fix Lifecycle Callbacks

Remove a bit of code that breaks lifecycle callbacks of parent MappedSuperclasses

Lets say we are working with this code:

```php
/**
* @MappedSuperclass
*/
abstract class BaseClass
{
/**
* @ORM\Column(name="last_modified", type="datetimetz", nullable=false)
* @var \DateTime
*/
protected $lastModified;

/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function setLastModifiedPreUpdate()
{
$this->setLastModified(new \DateTime());
}

/**
* @param \DateTime $lastModified
*/
public function setLastModified( $lastModified )
{
$this->lastModified = $lastModified;
}

/**
* @return \DateTime
*/
public function getLastModified()
{
return $this->lastModified;
}
}

/**
* Class MyClass
*
* @Entity
* @HasLifecycleCallbacks
*/
class MyClass extends BaseClass
{
// Whatever you want in here
}
```

And you want to save MyClass and have it call the Lifecycle callbacks for your BaseClass. If you leave things they way they are programmed today, the BaseClass will never get its callbacks registered.

By removing the little bit of code there [Lines 472-475], you now get lifecycle callbacks through the entire stack, not just the top most class.