protected function _postSave($is_new) { TBGScopeHostnamesTable::getTable()->saveScopeHostnames($this->getHostnames(), $this->getID()); // Load fixtures for this scope if it's a new scope if ($is_new) { if (!$this->isDefault()) { $prev_scope = TBGContext::getScope(); TBGContext::setScope($this); } $this->loadFixtures(); if (!$this->isDefault()) { TBGModule::installModule('publish', $this); TBGContext::setScope($prev_scope); TBGContext::clearPermissionsCache(); } } }
public final function uninstall($scope = null) { if ($this->isCore()) { throw new Exception('Cannot uninstall core modules'); } $scope = $scope === null ? TBGContext::getScope()->getID() : $scope; $this->_uninstall($scope); \b2db\Core::getTable('TBGModulesTable')->doDeleteById($this->getID()); TBGSettings::deleteModuleSettings($this->getName(), $scope); TBGContext::deleteModulePermissions($this->getName(), $scope); TBGContext::clearRoutingCache(); TBGContext::clearPermissionsCache(); }