<?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\Table() * @ORM\Entity(repositoryClass="App\Repository\ContinentRepository") * @ORM\HasLifecycleCallbacks */class Continent{ /** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $id; /** * @ORM\Column(type="boolean", nullable=true) */ private $isActive; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @Gedmo\Slug(fields={"name"}) * @ORM\Column(unique=true) */ private $slug; /** * @ORM\OneToMany(targetEntity="Country", mappedBy="continent") */ private $country; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** @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; } /** * Constructor */ public function __construct() { $this->country = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set isActive * * @param boolean $isActive * @return Continent */ public function setIsActive($isActive) { $this->isActive = $isActive; return $this; } /** * Get isActive * * @return boolean */ public function getIsActive() { return $this->isActive; } /** * Set name * * @param string $name * @return Continent */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set createdAt * * @param \DateTime $createdAt * @return Continent */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set updatedAt * * @param \DateTime $updatedAt * @return Continent */ public function setUpdatedAt($updatedAt) { $this->updatedAt = $updatedAt; return $this; } /** * Get updatedAt * * @return \DateTime */ public function getUpdatedAt() { return $this->updatedAt; } /** * Add country * * @param \App\Entity\Gos\Country $country * @return Continent */ public function addCountry(\App\Entity\Gos\Country $country) { $this->country[] = $country; return $this; } /** * Remove country * * @param \App\Entity\Gos\Country $country */ public function removeCountry(\App\Entity\Gos\Country $country) { $this->country->removeElement($country); } /** * Get country * * @return \Doctrine\Common\Collections\Collection */ public function getCountry() { return $this->country; } /** * Set slug * * @param string $slug * @return Continent */ public function setSlug($slug) { $this->slug = $slug; return $this; } /** * Get slug * * @return string */ public function getSlug() { return $this->slug; }}