2019-01-06 11:32:05 +00:00
|
|
|
<?php
|
2020-10-14 22:19:31 +00:00
|
|
|
|
2021-07-19 05:53:45 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-01-06 11:32:05 +00:00
|
|
|
namespace App\Controller\Api\Admin;
|
|
|
|
|
|
|
|
use App\Entity;
|
2019-04-07 08:40:55 +00:00
|
|
|
use OpenApi\Annotations as OA;
|
2019-01-06 11:32:05 +00:00
|
|
|
|
2021-07-19 05:53:45 +00:00
|
|
|
/**
|
2021-12-12 11:01:53 +00:00
|
|
|
* @OA\Get(path="/admin/custom_fields",
|
|
|
|
* operationId="getCustomFields",
|
|
|
|
* tags={"Administration: Custom Fields"},
|
|
|
|
* description="List all current custom fields in the system.",
|
|
|
|
* @OA\Response(response=200, description="Success",
|
|
|
|
* @OA\JsonContent(type="array", @OA\Items(ref="#/components/schemas/CustomField"))
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=403, description="Access denied"),
|
|
|
|
* security={{"api_key": {}}},
|
|
|
|
* )
|
|
|
|
*
|
|
|
|
* @OA\Post(path="/admin/custom_fields",
|
|
|
|
* operationId="addCustomField",
|
|
|
|
* tags={"Administration: Custom Fields"},
|
|
|
|
* description="Create a new custom field.",
|
|
|
|
* @OA\RequestBody(
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CustomField")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=200, description="Success",
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CustomField")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=403, description="Access denied"),
|
|
|
|
* security={{"api_key": {}}},
|
|
|
|
* )
|
|
|
|
*
|
|
|
|
* @OA\Get(path="/admin/custom_field/{id}",
|
|
|
|
* operationId="getCustomField",
|
|
|
|
* tags={"Administration: Custom Fields"},
|
|
|
|
* description="Retrieve details for a single custom field.",
|
|
|
|
* @OA\Parameter(
|
|
|
|
* name="id",
|
|
|
|
* in="path",
|
|
|
|
* description="ID",
|
|
|
|
* required=true,
|
|
|
|
* @OA\Schema(type="integer", format="int64")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=200, description="Success",
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CustomField")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=403, description="Access denied"),
|
|
|
|
* security={{"api_key": {}}},
|
|
|
|
* )
|
|
|
|
*
|
|
|
|
* @OA\Put(path="/admin/custom_field/{id}",
|
|
|
|
* operationId="editCustomField",
|
|
|
|
* tags={"Administration: Custom Fields"},
|
|
|
|
* description="Update details of a single custom field.",
|
|
|
|
* @OA\RequestBody(
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CustomField")
|
|
|
|
* ),
|
|
|
|
* @OA\Parameter(
|
|
|
|
* name="id",
|
|
|
|
* in="path",
|
|
|
|
* description="ID",
|
|
|
|
* required=true,
|
|
|
|
* @OA\Schema(type="integer", format="int64")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=200, description="Success",
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/Api_Status")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=403, description="Access denied"),
|
|
|
|
* security={{"api_key": {}}},
|
|
|
|
* )
|
|
|
|
*
|
|
|
|
* @OA\Delete(path="/admin/custom_field/{id}",
|
|
|
|
* operationId="deleteCustomField",
|
|
|
|
* tags={"Administration: Custom Fields"},
|
|
|
|
* description="Delete a single custom field.",
|
|
|
|
* @OA\Parameter(
|
|
|
|
* name="id",
|
|
|
|
* in="path",
|
|
|
|
* description="ID",
|
|
|
|
* required=true,
|
|
|
|
* @OA\Schema(type="integer", format="int64")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=200, description="Success",
|
|
|
|
* @OA\JsonContent(ref="#/components/schemas/Api_Status")
|
|
|
|
* ),
|
|
|
|
* @OA\Response(response=403, description="Access denied"),
|
|
|
|
* security={{"api_key": {}}},
|
|
|
|
* )
|
|
|
|
*
|
2021-07-19 05:53:45 +00:00
|
|
|
* @extends AbstractAdminApiCrudController<Entity\CustomField>
|
|
|
|
*/
|
2019-04-14 03:19:24 +00:00
|
|
|
class CustomFieldsController extends AbstractAdminApiCrudController
|
2019-01-06 11:32:05 +00:00
|
|
|
{
|
2019-12-07 12:19:49 +00:00
|
|
|
protected string $entityClass = Entity\CustomField::class;
|
|
|
|
protected string $resourceRouteName = 'api:admin:custom_field';
|
2019-01-06 11:32:05 +00:00
|
|
|
}
|