private function update()
 {
     //        $vc = version_compare($this->oldConfig->getVersion(), $this->newConfig->getVersion());
     //        if($vc != -1){
     //            return $this->modx->lexicon('gitpackagemanagement.package_err_nvil');
     //        }
     if ($this->oldConfig->getName() != $this->newConfig->getName()) {
         return $this->modx->lexicon('gitpackagemanagement.package_err_ccn');
     }
     if ($this->oldConfig->getLowCaseName() != $this->newConfig->getLowCaseName()) {
         return $this->modx->lexicon('gitpackagemanagement.package_err_ccln');
     }
     $this->object->set('description', $this->newConfig->getDescription());
     $this->object->set('version', $this->newConfig->getVersion());
     /** @var modCategory category */
     $this->category = $this->modx->getObject('modCategory', array('category' => $this->newConfig->getName()));
     if (!$this->category) {
         $this->category = $this->modx->newObject('modCategory');
         $this->category->set('category', $this->newConfig->getName());
         $this->category->save();
     }
     $this->updateDatabase();
     $this->updateActionsAndMenus();
     $this->updateExtensionPackage();
     $this->updateSystemSettings();
     $notUsedCategories = array();
     $this->updateCategories($notUsedCategories);
     $this->updateElements();
     $this->removeNotUsedCategories($notUsedCategories);
     $this->updateResources();
     $this->clearCache();
     return true;
 }
 public function beforeSave()
 {
     $key = trim($this->getProperty('key', ''));
     $this->object->set('key', $key);
     return parent::beforeSave();
 }