src/Entity/MatrixMovement.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Repository\MatrixMovementRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10.  * @ORM\Entity(repositoryClass=MatrixMovementRepository::class)
  11.  * @ApiResource(
  12.  *     collectionOperations={"get","post"},
  13.  *     itemOperations={"get","put","patch","delete"},
  14.  *     normalizationContext={"groups"={"matrixMovement"}},
  15.  *     denormalizationContext={"groups"={"matrixMovement"}},
  16.  *     attributes={"pagination_enabled"=false}
  17.  * )
  18.  * @UniqueEntity("reference")
  19.  */
  20. class MatrixMovement
  21. {
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      * @ApiProperty(identifier=false)
  27.      */
  28.     private $id;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Article::class)
  31.      * @ORM\JoinColumn(nullable=false)
  32.      * @Groups("matrixMovement")
  33.      */
  34.     private $article;
  35.     /**
  36.      * @ORM\Column(type="float", nullable=true)
  37.      */
  38.     private $amount;
  39.     /**
  40.      * @ORM\Column(type="string", length=60, unique=true)
  41.      * @Groups("matrixMovement")
  42.      * @ApiProperty(identifier=true)
  43.      */
  44.     private $reference;
  45.     /**
  46.      * @ORM\Column(type="string", length=60, nullable=true)
  47.      * @Groups("matrixMovement")
  48.      */
  49.     private $matrixReference;
  50.     /**
  51.      * @ORM\Column(type="array", nullable=true)
  52.      * @Groups("matrixMovement")
  53.      */
  54.     private $defaultPeriod = [];
  55.     /**
  56.      * @ORM\Column(type="array", nullable=true)
  57.      * @Groups("matrixMovement")
  58.      */
  59.     private $vacationPeriod = [];
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getArticle(): ?Article
  65.     {
  66.         return $this->article;
  67.     }
  68.     public function setArticle(?Article $article): self
  69.     {
  70.         $this->article $article;
  71.         return $this;
  72.     }
  73.     public function getAmount(): ?float
  74.     {
  75.         return $this->amount;
  76.     }
  77.     public function setAmount(float $amount): self
  78.     {
  79.         $this->amount $amount;
  80.         return $this;
  81.     }
  82.     public function getReference(): ?string
  83.     {
  84.         return $this->reference;
  85.     }
  86.     public function setReference(string $reference): self
  87.     {
  88.         $this->reference $reference;
  89.         return $this;
  90.     }
  91.     public function getMatrixReference(): ?string
  92.     {
  93.         return $this->matrixReference;
  94.     }
  95.     public function setMatrixReference(?string $matrixReference): self
  96.     {
  97.         $this->matrixReference $matrixReference;
  98.         return $this;
  99.     }
  100.     public function getDefaultPeriod(): ?array
  101.     {
  102.         return $this->defaultPeriod;
  103.     }
  104.     public function setDefaultPeriod(?array $defaultPeriod): self
  105.     {
  106.         $this->defaultPeriod $defaultPeriod;
  107.         return $this;
  108.     }
  109.     public function getVacationPeriod(): ?array
  110.     {
  111.         return $this->vacationPeriod;
  112.     }
  113.     public function setVacationPeriod(?array $vacationPeriod): self
  114.     {
  115.         $this->vacationPeriod $vacationPeriod;
  116.         return $this;
  117.     }
  118. }