Rename Api classes

This commit is contained in:
Frederic Guillot
2016-05-16 21:07:29 -04:00
parent 4514bc1d4b
commit b1e2ca00ce
21 changed files with 104 additions and 79 deletions

51
app/Api/GroupApi.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
namespace Kanboard\Api;
use Kanboard\Core\Base;
/**
* Group API controller
*
* @package Kanboard\Api
* @author Frederic Guillot
*/
class GroupApi extends Base
{
public function createGroup($name, $external_id = '')
{
return $this->group->create($name, $external_id);
}
public function updateGroup($group_id, $name = null, $external_id = null)
{
$values = array(
'id' => $group_id,
'name' => $name,
'external_id' => $external_id,
);
foreach ($values as $key => $value) {
if (is_null($value)) {
unset($values[$key]);
}
}
return $this->group->update($values);
}
public function removeGroup($group_id)
{
return $this->group->remove($group_id);
}
public function getGroup($group_id)
{
return $this->group->getById($group_id);
}
public function getAllGroups()
{
return $this->group->getAll();
}
}