src/V4/Model/Tab/Tab.php line 91

Open in your IDE?
  1. <?php
  2. namespace App\V4\Model\Tab;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Model\IriNormalizableInterface;
  6. use App\Model\NormalizeAsIRITrait;
  7. use App\Model\Traits\ImportableObjectTrait;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11.  * @ApiResource(
  12.  *     shortName="V4/Tab",
  13.  *     attributes={
  14.  *         "api_allow_update": true
  15.  *     },
  16.  *     collectionOperations={
  17.  *        "get": {
  18.  *             "path": "/V4/tabs",
  19.  *             "normalization_context": {
  20.  *                  "groups": {"tab:list"},
  21.  *                  "isFromAdmin": true
  22.  *             },
  23.  *             "security": "is_granted(constant('App\\V4\\Voters\\TabVoter::TAB_SHOW_LIST'), 'App\V4\Voters\TabVoter')"
  24.  *         },
  25.  *         "post_tab": {
  26.  *             "method": "POST",
  27.  *             "deserialize": false,
  28.  *             "write": false,
  29.  *             "controller": "App\V4\Controller\Tab\TabDataPersisterAction",
  30.  *             "path": "/V4/tabs",
  31.  *             "input_formats": {
  32.  *                 "multipart": {"multipart/form-data"}
  33.  *             },
  34.  *             "normalization_context": {
  35.  *                  "groups": {"tab:read"}
  36.  *             },
  37.  *             "denormalization_context": {
  38.  *                  "groups": {}
  39.  *             }
  40.  *         },
  41.  *         "get_form": {
  42.  *             "method": "GET",
  43.  *             "path": "/V4/tabs/form",
  44.  *             "controller": App\V4\Controller\Tab\GetTabFormAction::class
  45.  *         },
  46.  *     },
  47.  *     itemOperations={
  48.  *        "get": {
  49.  *             "path": "/V4/tabs/{id}",
  50.  *         },
  51.  *         "get_form": {
  52.  *             "method": "GET",
  53.  *             "path": "/V4/tabs/{id}/form",
  54.  *             "controller": App\V4\Controller\Tab\GetTabFormAction::class,
  55.  *             "normalization_context": {
  56.  *                  "isFromAdmin": true
  57.  *             },
  58.  *         },
  59.  *         "put_tab": {
  60.  *             "method": "POST",
  61.  *             "deserialize": false,
  62.  *             "write": false,
  63.  *             "controller": "App\V4\Controller\Tab\TabDataPersisterAction",
  64.  *             "path": "/V4/tabs/{id}",
  65.  *             "input_formats": {
  66.  *                 "multipart": {"multipart/form-data"}
  67.  *             },
  68.  *             "normalization_context": {
  69.  *                  "groups": {"tab:read"}
  70.  *             },
  71.  *             "denormalization_context": {
  72.  *                  "groups": {}
  73.  *             }
  74.  *         },
  75.  *         "delete_tab": {
  76.  *             "method": "DELETE",
  77.  *             "deserialize": false,
  78.  *             "write": false,
  79.  *             "controller": "App\V4\Controller\Tab\TabDataPersisterAction",
  80.  *             "path": "/V4/tabs/{id}",
  81.  *             "normalization_context": {
  82.  *                  "isFromAdmin": true
  83.  *             },
  84.  *         }
  85.  *     }
  86.  * )
  87.  */
  88. class Tab implements IriNormalizableInterface
  89. {
  90.     use ImportableObjectTrait;
  91.     use NormalizeAsIRITrait;
  92.     /**
  93.      * @ApiProperty(identifier=true)
  94.      *
  95.      * @var string|null
  96.      * @Groups({
  97.      *     "list",
  98.      *     "read",
  99.      *     "tab:list",
  100.      *     "tab:read",
  101.      *     "tab:write",
  102.      *     "tab:update"
  103.      * })
  104.      */
  105.     private $id;
  106.     /**
  107.      * @var string|null
  108.      * @Groups({
  109.      *     "list",
  110.      *     "read",
  111.      *     "tab:list",
  112.      *     "tab:read",
  113.      *     "tab:write",
  114.      *     "tab:update"
  115.      * })
  116.      */
  117.     private $customerId;
  118.     /**
  119.      * @var string|null
  120.      * @Assert\NotBlank(
  121.      *     message="Ce champ ne peut pas être vide"
  122.      * )
  123.      * @Groups({
  124.      *     "list",
  125.      *     "read",
  126.      *     "tab:list",
  127.      *     "tab:read",
  128.      *     "tab:write",
  129.      *     "tab:update"
  130.      * })
  131.      */
  132.     private $savedUserSearchInfo;
  133.     /**
  134.      * @var string|null
  135.      * @Groups({
  136.      *     "list",
  137.      *     "read",
  138.      *     "tab:list",
  139.      *     "tab:read",
  140.      *     "tab:write",
  141.      *     "tab:update"
  142.      * })
  143.      */
  144.     private $searchContent;
  145.     /**
  146.      * @var string|null
  147.      *
  148.      * @Assert\NotBlank(
  149.      *     message="Ce champ ne peut pas être vide"
  150.      * )
  151.      * @Groups({
  152.      *     "list",
  153.      *     "read",
  154.      *     "tab:list",
  155.      *     "tab:read",
  156.      *     "tab:write",
  157.      *     "tab:update"
  158.      * })
  159.      */
  160.     private $name;
  161.     /**
  162.      * @var string|null
  163.      *
  164.      * @Assert\NotBlank(
  165.      *     message="Ce champ ne peut pas être vide"
  166.      * )
  167.      * @Groups({
  168.      *     "list",
  169.      *     "read",
  170.      *     "tab:list",
  171.      *     "tab:read",
  172.      *     "tab:write",
  173.      *     "tab:update"
  174.      * })
  175.      */
  176.     private $title;
  177.     /**
  178.      * @var string|null
  179.      *
  180.      * @Assert\NotBlank(
  181.      *     message="Ce champ ne peut pas être vide"
  182.      * )
  183.      * @Groups({
  184.      *     "list",
  185.      *     "read",
  186.      *     "tab:list",
  187.      *     "tab:read",
  188.      *     "tab:write",
  189.      *     "tab:update"
  190.      * })
  191.      */
  192.     private $slug;
  193.     /**
  194.      * @var string|null
  195.      * @Groups({
  196.      *     "list",
  197.      *     "read",
  198.      *     "tab:list",
  199.      *     "tab:read",
  200.      *     "tab:write",
  201.      *     "tab:update"
  202.      * })
  203.      */
  204.     private $searchType;
  205.     /**
  206.      * @var string|null
  207.      * @Groups({
  208.      *     "list",
  209.      *     "read",
  210.      *     "tab:list",
  211.      *     "tab:read",
  212.      *     "tab:write",
  213.      *     "tab:update"
  214.      * })
  215.      */
  216.     private $groupLabel;
  217.     /**
  218.      * @var bool
  219.      * @Groups({
  220.      *     "list",
  221.      *     "read",
  222.      *     "tab:list",
  223.      *     "tab:read",
  224.      *     "tab:write",
  225.      *     "tab:update"
  226.      * })
  227.      */
  228.     private $isDisabledDisplaySublist false;
  229.     /**
  230.      * @var int|null
  231.      * @Groups({
  232.      *     "list",
  233.      *     "read",
  234.      *     "tab:list",
  235.      *     "tab:read",
  236.      *     "tab:write",
  237.      *     "tab:update"
  238.      * })
  239.      */
  240.     private $position 0;
  241.     /**
  242.      * @var string|null
  243.      * @Groups({
  244.      *     "list",
  245.      *     "read",
  246.      *     "tab:list",
  247.      *     "tab:read",
  248.      *     "tab:write",
  249.      *     "tab:update"
  250.      * })
  251.      */
  252.     private $role;
  253.     /**
  254.      * @var bool
  255.      *
  256.      * @Groups({
  257.      *     "list",
  258.      *     "read",
  259.      *     "tab:list",
  260.      *     "tab:read",
  261.      *     "tab:write",
  262.      *     "tab:update"
  263.      * })
  264.      */
  265.     private $isRoleNeeded false;
  266.     /**
  267.      * @var string|null
  268.      *
  269.      * @Groups({
  270.      *     "list",
  271.      *     "read",
  272.      *     "tab:list",
  273.      *     "tab:read",
  274.      *     "tab:write",
  275.      *     "tab:update"
  276.      * })
  277.      */
  278.     private $badgeId;
  279.     /**
  280.      * @return string|null
  281.      */
  282.     public function getId(): ?string
  283.     {
  284.         return $this->id;
  285.     }
  286.     /**
  287.      * @param string|null $id
  288.      *
  289.      * @return Tab
  290.      */
  291.     public function setId(?string $id): Tab
  292.     {
  293.         $this->id $id;
  294.         return $this;
  295.     }
  296.     /**
  297.      * @return string|null
  298.      */
  299.     public function getCustomerId(): ?string
  300.     {
  301.         return $this->customerId;
  302.     }
  303.     /**
  304.      * @param string|null $customerId
  305.      *
  306.      * @return Tab
  307.      */
  308.     public function setCustomerId(?string $customerId): Tab
  309.     {
  310.         $this->customerId $customerId;
  311.         return $this;
  312.     }
  313.     /**
  314.      * @return string|null
  315.      */
  316.     public function getName(): ?string
  317.     {
  318.         return $this->name;
  319.     }
  320.     /**
  321.      * @param string|null $name
  322.      *
  323.      * @return Tab
  324.      */
  325.     public function setName(?string $name): Tab
  326.     {
  327.         $this->name $name;
  328.         return $this;
  329.     }
  330.     /**
  331.      * @return string|null
  332.      */
  333.     public function getSavedUserSearchInfo(): ?string
  334.     {
  335.         return $this->savedUserSearchInfo;
  336.     }
  337.     /**
  338.      * @param string|null $savedUserSearchInfo
  339.      *
  340.      * @return Tab
  341.      */
  342.     public function setSavedUserSearchInfo(?string $savedUserSearchInfo): self
  343.     {
  344.         $this->savedUserSearchInfo $savedUserSearchInfo;
  345.         return $this;
  346.     }
  347.     /**
  348.      * @return string|null
  349.      */
  350.     public function getSearchContent(): ?string
  351.     {
  352.         return $this->searchContent;
  353.     }
  354.     /**
  355.      * @param string|null $searchContent
  356.      *
  357.      * @return Tab
  358.      */
  359.     public function setSearchContent(?string $searchContent): Tab
  360.     {
  361.         $this->searchContent $searchContent;
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return string|null
  366.      */
  367.     public function getTitle(): ?string
  368.     {
  369.         return $this->title;
  370.     }
  371.     /**
  372.      * @param string|null $title
  373.      *
  374.      * @return Tab
  375.      */
  376.     public function setTitle(?string $title): self
  377.     {
  378.         $this->title $title;
  379.         return $this;
  380.     }
  381.     /**
  382.      * @return string|null
  383.      */
  384.     public function getSlug(): ?string
  385.     {
  386.         return $this->slug;
  387.     }
  388.     /**
  389.      * @param string|null $slug
  390.      *
  391.      * @return Tab
  392.      */
  393.     public function setSlug(?string $slug): self
  394.     {
  395.         $this->slug $slug;
  396.         return $this;
  397.     }
  398.     /**
  399.      * @return string|null
  400.      */
  401.     public function getSearchType(): ?string
  402.     {
  403.         return $this->searchType;
  404.     }
  405.     /**
  406.      * @param string|null $searchType
  407.      *
  408.      * @return Tab
  409.      */
  410.     public function setSearchType(?string $searchType): self
  411.     {
  412.         $this->searchType $searchType;
  413.         return $this;
  414.     }
  415.     /**
  416.      * @return string|null
  417.      */
  418.     public function getGroupLabel(): ?string
  419.     {
  420.         return $this->groupLabel;
  421.     }
  422.     /**
  423.      * @param string|null $groupLabel
  424.      *
  425.      * @return Tab
  426.      */
  427.     public function setGroupLabel(?string $groupLabel): self
  428.     {
  429.         $this->groupLabel $groupLabel;
  430.         return $this;
  431.     }
  432.     /**
  433.      * @return bool
  434.      */
  435.     public function getIsDisabledDisplaySublist(): bool
  436.     {
  437.         return $this->isDisabledDisplaySublist;
  438.     }
  439.     /**
  440.      * @param bool $isDisabledDisplaySublist
  441.      *
  442.      * @return Tab
  443.      */
  444.     public function setIsDisabledDisplaySublist(bool $isDisabledDisplaySublist): self
  445.     {
  446.         $this->isDisabledDisplaySublist $isDisabledDisplaySublist;
  447.         return $this;
  448.     }
  449.     /**
  450.      * @return int|null
  451.      */
  452.     public function getPosition(): ?int
  453.     {
  454.         return $this->position;
  455.     }
  456.     /**
  457.      * @param int|null $position
  458.      *
  459.      * @return Tab
  460.      */
  461.     public function setPosition(?int $position): self
  462.     {
  463.         $this->position $position;
  464.         return $this;
  465.     }
  466.     /**
  467.      * @return string|null
  468.      */
  469.     public function getRole(): ?string
  470.     {
  471.         return $this->role;
  472.     }
  473.     /**
  474.      * @param string|null $role
  475.      *
  476.      * @return Tab
  477.      */
  478.     public function setRole(?string $role): self
  479.     {
  480.         $this->role $role;
  481.         return $this;
  482.     }
  483.     /**
  484.      * @return bool
  485.      */
  486.     public function isRoleNeeded(): bool
  487.     {
  488.         return $this->isRoleNeeded;
  489.     }
  490.     /**
  491.      * @param bool $isRoleNeeded
  492.      *
  493.      * @return Tab
  494.      */
  495.     public function setIsRoleNeeded(bool $isRoleNeeded): self
  496.     {
  497.         $this->isRoleNeeded $isRoleNeeded;
  498.         return $this;
  499.     }
  500.     /**
  501.      * @return string|null
  502.      */
  503.     public function getBadgeId(): ?string
  504.     {
  505.         return $this->badgeId;
  506.     }
  507.     /**
  508.      * @param string|null $badgeId
  509.      *
  510.      * @return Tab
  511.      */
  512.     public function setBadgeId(?string $badgeId): self
  513.     {
  514.         $this->badgeId $badgeId;
  515.         return $this;
  516.     }
  517. }