/** * Returns the node this even refers to, if it can be resolved. * * It might happen that, if this event refers to a node contained in a site which is not available anymore, * Doctrine's proxy class of the Site domain model will fail with an EntityNotFoundException. We catch this * case and return NULL. * * @return NodeInterface */ public function getNode() { try { $context = $this->contextFactory->create(array('workspaceName' => $this->userService->getUserWorkspace()->getName(), 'dimensions' => $this->dimension, 'currentSite' => $this->getCurrentSite(), 'invisibleContentShown' => true)); return $context->getNodeByIdentifier($this->nodeIdentifier); } catch (EntityNotFoundException $e) { return null; } }