<?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;/** * TermType * * @ORM\Table(name="term_type") * @ORM\Entity(repositoryClass="App\Repository\TermTypeRepository") * @ORM\HasLifecycleCallbacks */class TermType{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="name", type="string", length=255) */ private $name; /** * @var string * @Gedmo\Slug(fields={"name"}) * @ORM\Column(type="string", length=255, unique=true) */ private $slug; /** * @var bool * * @ORM\Column(name="isActive", type="boolean", nullable=true) */ private $isActive; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\Term", mappedBy="termType") */ private $terms; /** * @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->terms = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set name * * @param string $name * * @return TermType */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set slug * * @param string $slug * * @return TermType */ public function setSlug($slug) { $this->slug = $slug; return $this; } /** * Get slug * * @return string */ public function getSlug() { return $this->slug; } /** * Set isActive * * @param boolean $isActive * * @return TermType */ public function setIsActive($isActive) { $this->isActive = $isActive; return $this; } /** * Get isActive * * @return boolean */ public function getIsActive() { return $this->isActive; } /** * Set createdAt * * @param \DateTime $createdAt * * @return TermType */ 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 TermType */ public function setUpdatedAt($updatedAt) { $this->updatedAt = $updatedAt; return $this; } /** * Get updatedAt * * @return \DateTime */ public function getUpdatedAt() { return $this->updatedAt; } /** * Add term * * @param \App\Entity\Gos\Term $term * * @return TermType */ public function addTerm(\App\Entity\Gos\Term $term) { $this->terms[] = $term; return $this; } /** * Remove term * * @param \App\Entity\Gos\Term $term */ public function removeTerm(\App\Entity\Gos\Term $term) { $this->terms->removeElement($term); } /** * Get terms * * @return \Doctrine\Common\Collections\Collection */ public function getTerms() { return $this->terms; }}