opensupports/server/controllers/system/get-custom-fields.php
Guillermo Giuliana 791e0969e9
add script and change 4.7.0 to 4.8.0 (#848)
* add script and change 4.7.0 to 4.8

* change end of line 4.8.0 script

* Delete main.py
2020-07-22 07:32:18 -03:00

39 lines
851 B
PHP

<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /system/get-custom-fields Get custom fields
* @apiVersion 4.8.0
*
* @apiName Get all Custom field items
*
* @apiGroup System
*
* @apiDescription This path retrieves the all CustomField items.
*
* @apiPermission any
*
* @apiUse NO_PERMISSION
*
* @apiSuccess {[Customfield](#api-Data_Structures-ObjectCustomfield)[]} data Array of Customfield
*
*/
class GetCustomFieldsController extends Controller {
const PATH = '/get-custom-fields';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'any',
'requestData' => []
];
}
public function handler() {
$customFieldList = Customfield::getAll();
Response::respondSuccess($customFieldList->toArray());
}
}