more consistent naming

This commit is contained in:
Robin Appelman 2013-07-10 02:17:24 +02:00
parent db14775536
commit 065bc96b02
3 changed files with 8 additions and 8 deletions

View File

@ -84,7 +84,7 @@ class OC_Group {
public static function createGroup($gid) {
OC_Hook::emit("OC_Group", "pre_createGroup", array("run" => true, "gid" => $gid));
if (self::getManager()->create($gid)) {
if (self::getManager()->createGroup($gid)) {
OC_Hook::emit("OC_User", "post_createGroup", array("gid" => $gid));
return true;
} else {
@ -220,7 +220,7 @@ class OC_Group {
* @return bool
*/
public static function groupExists($gid) {
return self::getManager()->exists($gid);
return self::getManager()->groupExists($gid);
}
/**

View File

@ -93,7 +93,7 @@ class Manager extends PublicEmitter {
* @param string $gid
* @return bool
*/
public function exists($gid) {
public function groupExists($gid) {
return !is_null($this->get($gid));
}
@ -101,10 +101,10 @@ class Manager extends PublicEmitter {
* @param string $gid
* @return \OC\Group\Group
*/
public function create($gid) {
public function createGroup($gid) {
if (!$gid) {
return false;
} else if ($this->exists($gid)) {
} else if ($this->groupExists($gid)) {
return $this->get($gid);
} else {
$this->emit('\OC\Group', 'preCreate', array($gid));
@ -126,7 +126,7 @@ class Manager extends PublicEmitter {
* @param int $offset
* @return \OC\Group\Group[]
*/
public function search($search = '', $limit = null, $offset = null) {
public function search($search, $limit = null, $offset = null) {
$groups = array();
foreach ($this->backends as $backend) {
$groupIds = $backend->getGroups($search, $limit, $offset);

View File

@ -134,7 +134,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$manager = new \OC\Group\Manager($userManager);
$manager->addBackend($backend);
$group = $manager->create('group1');
$group = $manager->createGroup('group1');
$this->assertEquals('group1', $group->getGID());
}
@ -157,7 +157,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$manager = new \OC\Group\Manager($userManager);
$manager->addBackend($backend);
$group = $manager->create('group1');
$group = $manager->createGroup('group1');
$this->assertEquals('group1', $group->getGID());
}