Have googled this but cannot seem to find it... I have a (php) Listener class in which I need to know if i'm currently in admin edit page for a data object (similar to 'editmode' var in twig)... how to do this check in php?
Inside a Controller the editmode is available:
$this->editmode
but how to get this in a class that's not a controller (ie a listener class / any other class)?
Have you tried to do same as the Controller (eg. FrontentController) does ? https://github.com/pimcore/pimcore/blob/11.x/lib/Controller/FrontendController.php#L62
Thats the magic behind
$this->iseditmode