<?phpnamespace App\Entity;use App\Repository\SageVatRatesRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SageVatRatesRepository::class) * @ORM\HasLifecycleCallbacks */class SageVatRates{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=4) */ private $sageCode; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="float") */ private $iva; /** * @ORM\Column(type="datetime") */ private $syncDate; /** * @ORM\Column(type="datetime_immutable") */ private $createdAt; /** * @ORM\Column(type="datetime_immutable") */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=SageArticle::class, mappedBy="vatType") */ private $sageArticles; /** * @ORM\ManyToOne(targetEntity=SettingsCompany::class) * @ORM\JoinColumn(nullable=false) */ private $settingsCompany; public function __construct() { $this->sageArticles = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getSageCode(): ?string { return $this->sageCode; } public function setSageCode(string $sageCode): self { $this->sageCode = $sageCode; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getIva(): ?float { return $this->iva; } public function setIva(float $iva): self { $this->iva = $iva; return $this; } public function getSyncDate(): ?\DateTimeInterface { return $this->syncDate; } public function setSyncDate(\DateTimeInterface $syncDate): self { $this->syncDate = $syncDate; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @ORM\PrePersist */ public function prePersist(): void { $this->createdAt = new \DateTimeImmutable(); $this->updatedAt = new \DateTimeImmutable(); } /** * @ORM\PreUpdate */ public function preUpdate(): void { $this->updatedAt = new \DateTimeImmutable(); } /** * @return Collection<int, SageArticle> */ public function getSageArticles(): Collection { return $this->sageArticles; } public function addSageArticle(SageArticle $sageArticle): self { if (!$this->sageArticles->contains($sageArticle)) { $this->sageArticles[] = $sageArticle; $sageArticle->setVatType($this); } return $this; } public function removeSageArticle(SageArticle $sageArticle): self { if ($this->sageArticles->removeElement($sageArticle)) { // set the owning side to null (unless already changed) if ($sageArticle->getVatType() === $this) { $sageArticle->setVatType(null); } } return $this; } public function getSettingsCompany(): ?SettingsCompany { return $this->settingsCompany; } public function setSettingsCompany(?SettingsCompany $settingsCompany): self { $this->settingsCompany = $settingsCompany; return $this; }}