/** * Sets the plugin to active or inactive for $site_guid. * * @param bool $active Set to active or inactive * @param mixed $site_guid Int for specific site, null for current site. * * @return bool */ private function setStatus($active, $site_guid = null) { if (!$this->guid) { return false; } if ($site_guid) { $site = get_entity($site_guid); if (!$site instanceof \ElggSite) { return false; } } else { $site = _elgg_services()->configTable->get('site'); } if ($active) { $result = add_entity_relationship($this->guid, 'active_plugin', $site->guid); } else { $result = remove_entity_relationship($this->guid, 'active_plugin', $site->guid); } _elgg_invalidate_plugins_provides_cache(); return $result; }
/** * Sets the plugin to active or inactive. * * @param bool $active Set to active or inactive * * @return bool */ private function setStatus($active) { if (!$this->guid) { return false; } $site = _elgg_services()->configTable->get('site'); if ($active) { $result = add_entity_relationship($this->guid, 'active_plugin', $site->guid); } else { $result = remove_entity_relationship($this->guid, 'active_plugin', $site->guid); } _elgg_invalidate_plugins_provides_cache(); _elgg_services()->boot->invalidateCache(); return $result; }