src/Entity/SageVatRates.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SageVatRatesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SageVatRatesRepository::class)
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class SageVatRates
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=4)
  21.      */
  22.     private $sageCode;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $name;
  27.     /**
  28.      * @ORM\Column(type="float")
  29.      */
  30.     private $iva;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $syncDate;
  35.     /**
  36.      * @ORM\Column(type="datetime_immutable")
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime_immutable")
  41.      */
  42.     private $updatedAt;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=SageArticle::class, mappedBy="vatType")
  45.      */
  46.     private $sageArticles;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=SettingsCompany::class)
  49.      * @ORM\JoinColumn(nullable=false)
  50.      */
  51.     private $settingsCompany;
  52.     public function __construct()
  53.     {
  54.         $this->sageArticles = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getSageCode(): ?string
  61.     {
  62.         return $this->sageCode;
  63.     }
  64.     public function setSageCode(string $sageCode): self
  65.     {
  66.         $this->sageCode $sageCode;
  67.         return $this;
  68.     }
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     public function setName(string $name): self
  74.     {
  75.         $this->name $name;
  76.         return $this;
  77.     }
  78.     public function getIva(): ?float
  79.     {
  80.         return $this->iva;
  81.     }
  82.     public function setIva(float $iva): self
  83.     {
  84.         $this->iva $iva;
  85.         return $this;
  86.     }
  87.     public function getSyncDate(): ?\DateTimeInterface
  88.     {
  89.         return $this->syncDate;
  90.     }
  91.     public function setSyncDate(\DateTimeInterface $syncDate): self
  92.     {
  93.         $this->syncDate $syncDate;
  94.         return $this;
  95.     }
  96.     public function getCreatedAt(): ?\DateTimeImmutable
  97.     {
  98.         return $this->createdAt;
  99.     }
  100.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  101.     {
  102.         $this->createdAt $createdAt;
  103.         return $this;
  104.     }
  105.     public function getUpdatedAt(): ?\DateTimeImmutable
  106.     {
  107.         return $this->updatedAt;
  108.     }
  109.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  110.     {
  111.         $this->updatedAt $updatedAt;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @ORM\PrePersist
  116.      */
  117.     public function prePersist(): void
  118.     {
  119.         $this->createdAt = new \DateTimeImmutable();
  120.         $this->updatedAt = new \DateTimeImmutable();
  121.     }
  122.     /**
  123.      * @ORM\PreUpdate
  124.      */
  125.     public function preUpdate(): void
  126.     {
  127.         $this->updatedAt = new \DateTimeImmutable();
  128.     }
  129.     /**
  130.      * @return Collection<int, SageArticle>
  131.      */
  132.     public function getSageArticles(): Collection
  133.     {
  134.         return $this->sageArticles;
  135.     }
  136.     public function addSageArticle(SageArticle $sageArticle): self
  137.     {
  138.         if (!$this->sageArticles->contains($sageArticle)) {
  139.             $this->sageArticles[] = $sageArticle;
  140.             $sageArticle->setVatType($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeSageArticle(SageArticle $sageArticle): self
  145.     {
  146.         if ($this->sageArticles->removeElement($sageArticle)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($sageArticle->getVatType() === $this) {
  149.                 $sageArticle->setVatType(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function getSettingsCompany(): ?SettingsCompany
  155.     {
  156.         return $this->settingsCompany;
  157.     }
  158.     public function setSettingsCompany(?SettingsCompany $settingsCompany): self
  159.     {
  160.         $this->settingsCompany $settingsCompany;
  161.         return $this;
  162.     }
  163. }