<?phpnamespace App\Entity\Gos;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;/** * @ORM\Entity(repositoryClass="App\Repository\Gos\CurrencyRepository") * @ORM\HasLifecycleCallbacks() */class Currency{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="boolean", nullable=true) */ private $isActive; /** * @ORM\Column(type="string", length=191) */ private $name; /** * @ORM\Column(type="integer", nullable=true) */ private $decimals; /** * @Gedmo\Slug(fields={"name"}) * @ORM\Column(type="string", unique=true, length=191) */ private $slug; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\Country", mappedBy="currency") */ private $country; /** * @ORM\Column(type="text", length=255) */ private $code; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; public function __construct() { $this->country = new ArrayCollection(); } /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return (string)$this->name; } public function getId(): ?int { return $this->id; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDecimals(): ?int { return $this->decimals; } public function setDecimals(int $decimals): self { $this->decimals = $decimals; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection|Country[] */ public function getCountry(): Collection { return $this->country; } public function addCountry(Country $country): self { if (!$this->country->contains($country)) { $this->country[] = $country; $country->setCurrency($this); } return $this; } public function removeCountry(Country $country): self { if ($this->country->contains($country)) { $this->country->removeElement($country); // set the owning side to null (unless already changed) if ($country->getCurrency() === $this) { $country->setCurrency(null); } } return $this; }}