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.      * @ORM\ManyToOne(targetEntity=SettingsCompany::class)
  69.      * @ORM\JoinColumn(nullable=true)
  70.      */
  71.     private $settingsCompany;
  72.     
  73.     
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getSageCode(): ?string
  79.     {
  80.         return $this->sageCode;
  81.     }
  82.     public function setSageCode(string $sageCode): self
  83.     {
  84.         $this->sageCode $sageCode;
  85.         return $this;
  86.     }
  87.     public function getName(): ?string
  88.     {
  89.         return $this->name;
  90.     }
  91.     public function setName(string $name): self
  92.     {
  93.         $this->name $name;
  94.         return $this;
  95.     }
  96.     public function getDescription(): ?string
  97.     {
  98.         return $this->description;
  99.     }
  100.     public function setDescription(?string $description): self
  101.     {
  102.         $this->description $description;
  103.         return $this;
  104.     }
  105.     public function isActive(): ?bool
  106.     {
  107.         return $this->active;
  108.     }
  109.     public function setActive(bool $active): self
  110.     {
  111.         $this->active $active;
  112.         return $this;
  113.     }
  114.     public function isSentToSage(): ?bool
  115.     {
  116.         return $this->sentToSage;
  117.     }
  118.     public function setSentToSage(bool $sentToSage): self
  119.     {
  120.         $this->sentToSage $sentToSage;
  121.         return $this;
  122.     }
  123.     public function getSyncDate(): ?\DateTimeInterface
  124.     {
  125.         return $this->syncDate;
  126.     }
  127.     public function setSyncDate(?\DateTimeInterface $syncDate): self
  128.     {
  129.         $this->syncDate $syncDate;
  130.         return $this;
  131.     }
  132.     public function getCreatedAt(): ?\DateTimeImmutable
  133.     {
  134.         return $this->createdAt;
  135.     }
  136.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  137.     {
  138.         $this->createdAt $createdAt;
  139.         return $this;
  140.     }
  141.     public function getUpdatedAt(): ?\DateTimeImmutable
  142.     {
  143.         return $this->updatedAt;
  144.     }
  145.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  146.     {
  147.         $this->updatedAt $updatedAt;
  148.         return $this;
  149.     }
  150.     public function getFamily(): ?SageFamily
  151.     {
  152.         return $this->family;
  153.     }
  154.     public function setFamily(?SageFamily $family): self
  155.     {
  156.         $this->family $family;
  157.         return $this;
  158.     }
  159.     public function getSubfamily(): ?SageSubFamily
  160.     {
  161.         return $this->subfamily;
  162.     }
  163.     public function setSubfamily(?SageSubFamily $subfamily): self
  164.     {
  165.         $this->subfamily $subfamily;
  166.         return $this;
  167.     }
  168.     public function getDischargeDate(): ?\DateTimeInterface
  169.     {
  170.         return $this->dischargeDate;
  171.     }
  172.     public function setDischargeDate(\DateTimeInterface $dischargeDate): self
  173.     {
  174.         $this->dischargeDate $dischargeDate;
  175.         return $this;
  176.     }
  177.     public function getVatType(): ?SageVatRates
  178.     {
  179.         return $this->vatType;
  180.     }
  181.     public function setVatType(?SageVatRates $vatType): self
  182.     {
  183.         $this->vatType $vatType;
  184.         return $this;
  185.     }
  186.     public function getSettingsCompany(): ?SettingsCompany
  187.     {
  188.         return $this->settingsCompany;
  189.     }
  190.     public function setSettingsCompany(?SettingsCompany $settingsCompany): self
  191.     {
  192.         $this->settingsCompany $settingsCompany;
  193.         return $this;
  194.     }
  195.     /**
  196.      * @ORM\PrePersist
  197.      */
  198.     public function prePersist(): void
  199.     {
  200.         $this->createdAt = new \DateTimeImmutable();
  201.         $this->updatedAt = new \DateTimeImmutable();
  202.     }
  203.     
  204.     /**
  205.      * @ORM\PreUpdate
  206.      */
  207.     public function preUpdate(): void
  208.     {
  209.         $this->updatedAt = new \DateTimeImmutable();
  210.     }
  211. }