/** * Magic method before */ public function before() { // get full name of update object $class = 'Apps\\Controller\\Admin\\' . $this->_record->sys_name; if (class_exists($class)) { $this->_callback = $class; } else { throw new NotFoundException(__('Admin controller is not founded - %c%', ['c' => $this->_record->sys_name])); } // compare versions if ($this->_record->checkVersion() === true) { throw new ForbiddenException('Extension is not be updated - version comparing done successful'); } // set public attributes to display $this->name = $this->_record->getLocaleName(); $this->dbVersion = $this->_record->version; $this->scriptVersion = $this->_record->getScriptVersion(); $this->date = Date::convertToDatetime($this->_record->updated_at, Date::FORMAT_TO_HOUR); }