Skip to content

Instantly share code, notes, and snippets.

@jpetitcolas
Created September 19, 2013 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpetitcolas/6620559 to your computer and use it in GitHub Desktop.
Save jpetitcolas/6620559 to your computer and use it in GitHub Desktop.
Detecting a property change on Doctrine2 listener
private function updateLastUpdateDate(LifecycleEventArgs $eventArgs)
{
$changeSet = $eventArgs->getEntityManager()->getUnitOfWork()->getEntityChangeSet($this);
if (!array_key_exists('status', $changeSet)) {
return;
}
// $statusBefore = $changeSet['status'][0];
// $statusAfter = $changeSet['status'][1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment