public function preDispatch() { parent::preDispatch(); if ($this->getParam('ctype') === 'document') { $this->element = Document::getById((int) $this->getParam('cid', 0)); } elseif ($this->getParam('ctype') === 'asset') { $this->element = Asset::getById((int) $this->getParam('cid', 0)); } elseif ($this->getParam('ctype') === 'object') { $this->element = ConcreteObject::getById((int) $this->getParam('cid', 0)); } if (!$this->element) { throw new \Exception('Cannot load element' . $this->getParam('cid') . ' of type \'' . $this->getParam('ctype') . '\''); } //get the latest available version of the element - //$this->element = $this->getLatestVersion($this->element); $this->element->setUserModification($this->getUser()->getId()); }