Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| taoItems_actions_RestItems | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getParametersAliases | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| getParametersRequirements | |
0.00% |
0 / 7 |
|
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 | */ |
| 19 | |
| 20 | use oat\tao\model\routing\AnnotationReader\security; |
| 21 | |
| 22 | /** |
| 23 | * |
| 24 | * @author plichart |
| 25 | */ |
| 26 | class taoItems_actions_RestItems extends tao_actions_CommonRestModule |
| 27 | { |
| 28 | /** |
| 29 | * taoItems_actions_RestItems constructor. |
| 30 | * @security("hide") |
| 31 | */ |
| 32 | public function __construct() |
| 33 | { |
| 34 | parent::__construct(); |
| 35 | //The service taht implements or inherits get/getAll/getRootClass ... for that particular type of resources |
| 36 | $this->service = taoItems_models_classes_CrudItemsService::singleton(); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Optionnaly a specific rest controller may declare |
| 41 | * aliases for parameters used for the rest communication |
| 42 | */ |
| 43 | protected function getParametersAliases() |
| 44 | { |
| 45 | return array_merge(parent::getParametersAliases(), [ |
| 46 | "model" => taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL, |
| 47 | "content" => taoItems_models_classes_ItemsService::PROPERTY_ITEM_CONTENT |
| 48 | ]); |
| 49 | } |
| 50 | /** |
| 51 | * Optionnal Requirements for parameters to be sent on every service |
| 52 | * |
| 53 | */ |
| 54 | protected function getParametersRequirements() |
| 55 | { |
| 56 | return [ |
| 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 | |
| 63 | ]; |
| 64 | } |
| 65 | } |