/** * Remove an Agent member or a Group from this Group. If the Agent or Group * is not in this group no action is taken and no exception is thrown. * * @param object Agent $memberOrGroup * * @throws object AgentException An exception with one of the * following messages defined in org.osid.agent.AgentException may * be thrown: {@link * org.osid.agent.AgentException#OPERATION_FAILED * OPERATION_FAILED}, {@link * org.osid.agent.AgentException#PERMISSION_DENIED * PERMISSION_DENIED}, {@link * org.osid.agent.AgentException#CONFIGURATION_ERROR * CONFIGURATION_ERROR}, {@link * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}, * {@link org.osid.agent.AgentException#UNKNOWN_ID UNKNOWN_ID}, * {@link org.osid.agent.AgentException#NULL_ARGUMENT * NULL_ARGUMENT} * * @access public */ function remove(Agent $memberOrGroup) { throwError(new Error(AgentException::PERMISSION_DENIED(), "UsersGroup", true)); }
/** * Delete the Group with the specified unique Id. * * @param object Id $id * * @throws object AgentException An exception with one of the * following messages defined in org.osid.agent.AgentException may * be thrown: {@link * org.osid.agent.AgentException#OPERATION_FAILED * OPERATION_FAILED}, {@link * org.osid.agent.AgentException#PERMISSION_DENIED * PERMISSION_DENIED}, {@link * org.osid.agent.AgentException#CONFIGURATION_ERROR * CONFIGURATION_ERROR}, {@link * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}, * {@link org.osid.agent.AgentException#NULL_ARGUMENT * NULL_ARGUMENT}, {@link org.osid.agent.AgentException#UNKNOWN_ID * UNKNOWN_ID} * * @access public */ function deleteGroup(Id $id) { //remove the properties of the agent from the database $propertyManager = Services::getService("Property"); $propertyManager->deleteAllProperties($id->getIdString()); // Get the node for the agent $hierarchyManager = Services::getService("Hierarchy"); $hierarchy = $hierarchyManager->getHierarchy($this->_hierarchyId); if (!$hierarchy->nodeExists($id)) { throwError(new Error(AgentException::PERMISSION_DENIED(), "GroupManager", true)); } $hierarchy->deleteNode($id); // update our cache for isGroup if (isset($this->_groupTreeIds) && is_array($this->_groupTreeIds)) { unset($this->_groupTreeIds[$id->getIdString()]); } }