Created
October 5, 2016 11:56
-
-
Save brusch/28322b1299f4330c519de837bbfb6d41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\Pimcore::getEventManager()->attach("admin.controller.postInit", function ($event) { | |
$controller = $event->getTarget(); | |
if($controller->getParam("controller") == "object" && $controller->getParam("action") == "update") { | |
$object = \Pimcore\Model\Object::getById($controller->getParam("id")); | |
// do with the object whatever you want | |
// later in ObjectController::updateAction() the pimcore admin will get the same instance of this object | |
// since ::getById() returns always the same object for an ID | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment