src/Entity/Ean/Participation/EanStep.php line 52

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Ean\Participation;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Ean\EanStepRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Symfony\Component\Serializer\Annotation\SerializedName;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EanStepRepository::class)
  10.  * @ApiResource(
  11.  *     attributes={
  12.  *          "normalization_context"={
  13.  *              "groups"={
  14.  *                  "EanStep:output",
  15.  *                  "EanStep:io",
  16.  *               }
  17.  *          },
  18.  *          "denormalization_context"={
  19.  *              "groups"={
  20.  *                  "EanStep:input",
  21.  *                  "EanStep:io",
  22.  *              }
  23.  *          }
  24.  *      },
  25.  *     collectionOperations={
  26.  *          "post"={
  27.  *              "method"="POST",
  28.  *              "access_control"="is_granted('ROLE_USER')",
  29.  *          },
  30.  *          "admin-post"={
  31.  *              "method"="POST",
  32.  *              "path"="/admin/ean_steps",
  33.  *              "access_control"="is_granted('ROLE_ADMIN_API')",
  34.  *              "validation_groups"={"Default", "Create"}
  35.  *          },
  36.  *          "get"={
  37.  *              "method"="GET",
  38.  *              "access_control"="is_granted('ROLE_USER')",
  39.  *          },
  40.  *     },
  41.  *     itemOperations={
  42.  *          "get"={
  43.  *              "method"="GET",
  44.  *              "access_control"="is_granted('ROLE_USER')",
  45.  *          },
  46.  *     },
  47.  * )
  48.  */
  49. class EanStep extends EanParticipation
  50. {
  51.     /**
  52.      * @SerializedName("validated_quantity")
  53.      * @Groups({
  54.      *     "ParticipationStep:io",
  55.      *     "get_participation-steps_by_user",
  56.      * })
  57.      */
  58.     private ?int $validatedQuantity null;
  59.     public function getValidatedQuantity(): ?int
  60.     {
  61.         return $this->validatedQuantity;
  62.     }
  63.     public function setValidatedQuantity($validatedQuantity null): self
  64.     {
  65.         $this->validatedQuantity $validatedQuantity;
  66.         return $this;
  67.     }
  68. }