ElggPlugin::setStatus PHP Method

setStatus() private method

Sets the plugin to active or inactive.
private setStatus ( boolean $active ) : boolean
$active boolean Set to active or inactive
return boolean
    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;
    }