/** * delete the group * * @return bool */ public function delete() { $result = false; if ($this->emitter) { $this->emitter->emit('\\OC\\Group', 'preDelete', array($this)); } foreach ($this->backends as $backend) { if ($backend->implementsActions(OC_GROUP_BACKEND_DELETE_GROUP)) { $result = true; $backend->deleteGroup($this->gid); } } if ($result and $this->emitter) { $this->emitter->emit('\\OC\\Group', 'postDelete', array($this)); } return $result; }
/** * delete the group * * @return bool */ public function delete() { // Prevent users from deleting group admin if ($this->getGID() === 'admin') { return false; } $result = false; if ($this->emitter) { $this->emitter->emit('\\OC\\Group', 'preDelete', array($this)); } foreach ($this->backends as $backend) { if ($backend->implementsActions(\OC_Group_Backend::DELETE_GROUP)) { $result = true; $backend->deleteGroup($this->gid); } } if ($result and $this->emitter) { $this->emitter->emit('\\OC\\Group', 'postDelete', array($this)); } return $result; }
/** * @param string $scope * @param string $method * @param Node[] $arguments */ public function emit($scope, $method, $arguments = array()) { $this->emitter->emit($scope, $method, $arguments); }