src/Entity/SageArticle.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SageArticleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=SageArticleRepository::class)
  7.  * @ORM\HasLifecycleCallbacks
  8.  */
  9. class SageArticle
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=20, unique=true)
  19.      */
  20.     private $sageCode;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="text", nullable=true)
  27.      */
  28.     private $description;
  29.     /**
  30.      * @ORM\Column(type="boolean")
  31.      */
  32.     private $active;
  33.     /**
  34.      * @ORM\Column(type="boolean")
  35.      */
  36.     private $sentToSage;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $syncDate;
  41.     /**
  42.      * @ORM\Column(type="datetime_immutable")
  43.      */
  44.     private $createdAt;
  45.     /**
  46.      * @ORM\Column(type="datetime_immutable")
  47.      */
  48.     private $updatedAt;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity=SageFamily::class, inversedBy="sageArticles")
  51.      * @ORM\JoinColumn(nullable=false)
  52.      */
  53.     private $family;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity=SageSubFamily::class, inversedBy="sageArticles")
  56.      */
  57.     private $subfamily;
  58.     /**
  59.      * @ORM\Column(type="datetime")
  60.      */
  61.     private $dischargeDate;
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity=SageVatRates::class, inversedBy="sageArticles")
  64.      * @ORM\JoinColumn(nullable=false)
  65.      */
  66.     private $vatType;
  67.     
  68.     
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getSageCode(): ?string
  74.     {
  75.         return $this->sageCode;
  76.     }
  77.     public function setSageCode(string $sageCode): self
  78.     {
  79.         $this->sageCode $sageCode;
  80.         return $this;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     public function setName(string $name): self
  87.     {
  88.         $this->name $name;
  89.         return $this;
  90.     }
  91.     public function getDescription(): ?string
  92.     {
  93.         return $this->description;
  94.     }
  95.     public function setDescription(?string $description): self
  96.     {
  97.         $this->description $description;
  98.         return $this;
  99.     }
  100.     public function isActive(): ?bool
  101.     {
  102.         return $this->active;
  103.     }
  104.     public function setActive(bool $active): self
  105.     {
  106.         $this->active $active;
  107.         return $this;
  108.     }
  109.     public function isSentToSage(): ?bool
  110.     {
  111.         return $this->sentToSage;
  112.     }
  113.     public function setSentToSage(bool $sentToSage): self
  114.     {
  115.         $this->sentToSage $sentToSage;
  116.         return $this;
  117.     }
  118.     public function getSyncDate(): ?\DateTimeInterface
  119.     {
  120.         return $this->syncDate;
  121.     }
  122.     public function setSyncDate(?\DateTimeInterface $syncDate): self
  123.     {
  124.         $this->syncDate $syncDate;
  125.         return $this;
  126.     }
  127.     public function getCreatedAt(): ?\DateTimeImmutable
  128.     {
  129.         return $this->createdAt;
  130.     }
  131.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  132.     {
  133.         $this->createdAt $createdAt;
  134.         return $this;
  135.     }
  136.     public function getUpdatedAt(): ?\DateTimeImmutable
  137.     {
  138.         return $this->updatedAt;
  139.     }
  140.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  141.     {
  142.         $this->updatedAt $updatedAt;
  143.         return $this;
  144.     }
  145.     public function getFamily(): ?SageFamily
  146.     {
  147.         return $this->family;
  148.     }
  149.     public function setFamily(?SageFamily $family): self
  150.     {
  151.         $this->family $family;
  152.         return $this;
  153.     }
  154.     public function getSubfamily(): ?SageSubFamily
  155.     {
  156.         return $this->subfamily;
  157.     }
  158.     public function setSubfamily(?SageSubFamily $subfamily): self
  159.     {
  160.         $this->subfamily $subfamily;
  161.         return $this;
  162.     }
  163.     public function getDischargeDate(): ?\DateTimeInterface
  164.     {
  165.         return $this->dischargeDate;
  166.     }
  167.     public function setDischargeDate(\DateTimeInterface $dischargeDate): self
  168.     {
  169.         $this->dischargeDate $dischargeDate;
  170.         return $this;
  171.     }
  172.     public function getVatType(): ?SageVatRates
  173.     {
  174.         return $this->vatType;
  175.     }
  176.     public function setVatType(?SageVatRates $vatType): self
  177.     {
  178.         $this->vatType $vatType;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @ORM\PrePersist
  183.      */
  184.     public function prePersist(): void
  185.     {
  186.         $this->createdAt = new \DateTimeImmutable();
  187.         $this->updatedAt = new \DateTimeImmutable();
  188.     }
  189.     
  190.     /**
  191.      * @ORM\PreUpdate
  192.      */
  193.     public function preUpdate(): void
  194.     {
  195.         $this->updatedAt = new \DateTimeImmutable();
  196.     }
  197. }