<?php
namespace App\V4\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* shortName="V4/CustomAction",
* attributes={
* "api_allow_update": true
* },
* collectionOperations={
* "get": {
* "path": "/V4/custom_actions",
* "normalization_context": {
* "groups": {"custom_action:list"}
* }
* },
* "post_custom_action": {
* "method": "POST",
* "deserialize": false,
* "write": false,
* "controller": "App\V4\Controller\CustomAction\CustomActionDataPersisterAction",
* "path": "/V4/custom_actions",
* "input_formats": {
* "multipart": {"multipart/form-data"}
* },
* "normalization_context": {
* "groups": {"custom_action:write"}
* },
* "denormalization_context": {
* "groups": {}
* }
* },
* "get_form": {
* "method": "GET",
* "path": "/V4/custom_actions/form",
* "controller": App\V4\Controller\CustomAction\GetCustomActionFormAction::class
* },
* },
* itemOperations={
* "get": {
* "path": "/V4/custom_actions/{id}",
* "normalization_context": {
* "groups": {"custom_action:read"}
* }
* },
* "get_form": {
* "method": "GET",
* "path": "/V4/custom_actions/{id}/form",
* "controller": App\V4\Controller\CustomAction\GetCustomActionFormAction::class
* },
* "put_custom_action": {
* "method": "POST",
* "deserialize": false,
* "write": false,
* "controller": "App\V4\Controller\CustomAction\CustomActionDataPersisterAction",
* "path": "/V4/custom_actions/{id}",
* "input_formats": {
* "multipart": {"multipart/form-data"}
* },
* "normalization_context": {
* "groups": {"custom_action:update"}
* },
* "denormalization_context": {
* "groups": {}
* }
* },
* "apply": {
* "method": "POST",
* "deserialize": false,
* "write": false,
* "controller": "App\V4\Controller\CustomAction\CustomActionAction",
* "path": "/custom-actions/{id}/apply",
* "input_formats": {
* "multipart": {"multipart/form-data"}
* }
* },
* "delete": {
* "path": "/V4/custom_actions/{id}",
* }
* }
* )
*
* @ApiFilter(SearchFilter::class, properties={
* "id": "exact",
* "customerId": "exact"
* })
*
* @ORM\Entity(repositoryClass="App\V4\Repository\CustomActionRepository")
* @ORM\Table(name="custom_action", indexes={
* @ORM\Index(name="IX_CustomerAction_CustomerId", columns={"customer_id"})
* })
*/
class CustomAction
{
/**
* @var string
*
* @ApiProperty(identifier=true)
*
* @ORM\Id()
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="App\Doctrine\UuidGenerator")
* @ORM\Column(name="id", type="string")
*
* @Groups({
* "custom_action:list", "custom_action:read"
* })
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=100)
*
* @Groups({
* "custom_action:list", "custom_action:read", "custom_action:write", "custom_action:update"
* })
*/
private $name;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "custom_action:list", "custom_action:read", "custom_action:write", "custom_action:update"
* })
*/
private $entity;
/**
* @var string
*
* @ORM\Column(type="text")
*
* @Groups({
* "custom_action:list", "custom_action:read", "custom_action:write", "custom_action:update"
* })
*/
private $config;
/**
* @var int
*
* @ORM\Column(type="integer", options={"default": 0})
*
* @Groups({
* "custom_action:list", "custom_action:read", "custom_action:write", "custom_action:update"
* })
*/
private $position;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "custom_action:list", "custom_action:read", "custom_action:write"
* })
*/
private $customerId;
/**
* @return string|null
*/
public function getId(): ?string
{
return $this->id;
}
/**
* @param string|null $id
*
* @return $this
*/
public function setId(?string $id): self
{
$this->id = $id;
return $this;
}
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string $name
*
* @return $this
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return string|null
*/
public function getEntity(): ?string
{
return $this->entity;
}
/**
* @param string $entity
*
* @return $this
*/
public function setEntity(string $entity): self
{
$this->entity = $entity;
return $this;
}
/**
* @return string|null
*/
public function getConfig(): ?string
{
return $this->config;
}
/**
* @param string $config
*
* @return $this
*/
public function setConfig(string $config): self
{
$this->config = $config;
return $this;
}
/**
* @return int
*/
public function getPosition(): ?int
{
return $this->position;
}
/**
* @param int $position
*
* @return $this
*/
public function setPosition(int $position): self
{
$this->position = $position;
return $this;
}
/**
* @return string
*/
public function getCustomerId(): ?string
{
return $this->customerId;
}
/**
* @param string $customerId
*
* @return $this
*/
public function setCustomerId(string $customerId): self
{
$this->customerId = $customerId;
return $this;
}
}