Skip to content

Instantly share code, notes, and snippets.

@brusch
Created October 6, 2016 13:39
Show Gist options
  • Save brusch/af167f957fab668f1c53d2a9a289b23a to your computer and use it in GitHub Desktop.
Save brusch/af167f957fab668f1c53d2a9a289b23a to your computer and use it in GitHub Desktop.
<?php
\Pimcore::getEventManager()->attach("object.preUpdate", function (\Zend_EventManager_Event $event) {
$newObject = $event->getTarget();
\Pimcore::collectGarbage();
$oldObject = \Pimcore\Model\Object::getById($newObject);
if($newObject->getKey() != $oldObject->getKey()) {
// ...
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment