src/Flexy/ShopBundle/Entity/Order/Adjustment.php line 13

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Order;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Repository\Order\AdjustmentRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ApiResource(
  7.     attributes: ["security" => "is_granted('ROLE_DEV')"],
  8. )]
  9. #[ORM\Entity(repositoryClassAdjustmentRepository::class)]
  10. class Adjustment
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  17.     private ?\DateTimeImmutable $createdAt null;
  18.     #[ORM\ManyToOne(targetEntityOrder::class, inversedBy'adjustments')]
  19.     private ?\App\Flexy\ShopBundle\Entity\Order\Order $parentOrder null;
  20.     #[ORM\Column(type'float')]
  21.     private ?float $amount null;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private ?string $type null;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private ?string $label null;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getCreatedAt(): ?\DateTimeImmutable
  31.     {
  32.         return $this->createdAt;
  33.     }
  34.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  35.     {
  36.         $this->createdAt $createdAt;
  37.         return $this;
  38.     }
  39.     public function getParentOrder(): ?Order
  40.     {
  41.         return $this->parentOrder;
  42.     }
  43.     public function setParentOrder(?Order $parentOrder): self
  44.     {
  45.         $this->parentOrder $parentOrder;
  46.         return $this;
  47.     }
  48.     public function getAmount(): ?float
  49.     {
  50.         return $this->amount;
  51.     }
  52.     public function setAmount(float $amount): self
  53.     {
  54.         $this->amount $amount;
  55.         return $this;
  56.     }
  57.     public function getType(): ?string
  58.     {
  59.         return $this->type;
  60.     }
  61.     public function setType(?string $type): self
  62.     {
  63.         $this->type $type;
  64.         return $this;
  65.     }
  66.     public function getLabel(): ?string
  67.     {
  68.         return $this->label;
  69.     }
  70.     public function setLabel(?string $label): self
  71.     {
  72.         $this->label $label;
  73.         return $this;
  74.     }
  75. }