Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| Api | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| getCrudService | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| getParametersAliases | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getParametersRequirements | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA |
| 19 | */ |
| 20 | |
| 21 | namespace oat\taoGroups\controller; |
| 22 | |
| 23 | use oat\taoGroups\models\CrudGroupsService; |
| 24 | use oat\taoGroups\models\GroupsService; |
| 25 | use tao_actions_CommonRestModule; |
| 26 | |
| 27 | /** |
| 28 | * @author plichart |
| 29 | */ |
| 30 | class Api extends tao_actions_CommonRestModule |
| 31 | { |
| 32 | /** |
| 33 | * @return CrudGroupsService |
| 34 | */ |
| 35 | protected function getCrudService() |
| 36 | { |
| 37 | if (!$this->service) { |
| 38 | $this->service = CrudGroupsService::singleton(); |
| 39 | } |
| 40 | |
| 41 | return $this->service; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Optionnaly a specific rest controller may declare |
| 46 | * aliases for parameters used for the rest communication |
| 47 | */ |
| 48 | protected function getParametersAliases() |
| 49 | { |
| 50 | return array_merge(parent::getParametersAliases(), [ |
| 51 | 'member' => GroupsService::PROPERTY_MEMBERS_URI, |
| 52 | ]); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Optionnal Requirements for parameters to be sent on every service |
| 57 | * you may use either the alias or the uri, if the parameter identifier |
| 58 | * is set it will become mandatory for the method/operation in $key |
| 59 | * Default Parameters Requirents are applied |
| 60 | * type by default is not required and the root class type is applied |
| 61 | * |
| 62 | * @example :"post"=> array("login", "password") |
| 63 | */ |
| 64 | protected function getParametersRequirements() |
| 65 | { |
| 66 | return []; |
| 67 | } |
| 68 | } |