add new api-module to output list of possible modules/functions

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-18 10:19:17 +01:00
parent bdfd601dae
commit 532551263d
6 changed files with 272 additions and 13 deletions

View File

@@ -1,8 +1,13 @@
<?php
class Customers extends ApiCommand
class Customers extends ApiCommand implements ResourceEntity
{
/**
* lists all customer entries
*
* @return array count|list
*/
public function list()
{
if ($this->isAdmin()) {
@@ -32,6 +37,14 @@ class Customers extends ApiCommand
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* return a customer entry by id
*
* @param int $id customer-id
*
* @throws Exception
* @return array
*/
public function get()
{
if ($this->isAdmin()) {
@@ -655,6 +668,14 @@ class Customers extends ApiCommand
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* delete a customer entry by id
*
* @param int $id customer-id
*
* @throws Exception
* @return array
*/
public function delete()
{
if ($this->isAdmin()) {
@@ -880,6 +901,14 @@ class Customers extends ApiCommand
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* unlock a locked customer by id
*
* @param int $id customer-id
*
* @throws Exception
* @return array
*/
public function unlock()
{
if ($this->isAdmin()) {