src/Entity/Gos/TermText.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * TermText
  9.  *
  10.  * @ORM\Table(name="term_text")
  11.  * @ORM\Entity(repositoryClass="App\Repository\TermTextRepository")
  12.  * @ORM\HasLifecycleCallbacks
  13.  */
  14. class TermText
  15. {
  16.     /**
  17.      * @var int
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var int
  25.      * @ORM\Column(name="is_active", type="boolean", options={"default": 0})
  26.      */
  27.     private $isActive;
  28.     /**
  29.      * @var string
  30.      * @ORM\Column(name="term_text", type="text")
  31.      */
  32.     private $termText;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Term", inversedBy="termText")
  35.      * @ORM\JoinColumn(name="term_id", referencedColumnName="id", onDelete="cascade")
  36.      */
  37.     private $term;
  38.     /**
  39.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\Term", inversedBy="activeTermText")
  40.      * @ORM\JoinColumn(onDelete="cascade")
  41.      */
  42.     private $activeTerm;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTerms", mappedBy="termText")
  45.      */
  46.     private $userTerms;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $createdAt;
  51.     /** @ORM\PrePersist() */
  52.     public function prePersist()
  53.     {
  54.         $this->createdAt = new \DateTime();
  55.     }
  56.     //------------------------------ setters & getters
  57.     /**
  58.      * Get id
  59.      *
  60.      * @return integer
  61.      */
  62.     public function getId()
  63.     {
  64.         return $this->id;
  65.     }
  66.     /**
  67.      * Set isActive
  68.      *
  69.      * @param boolean $isActive
  70.      *
  71.      * @return TermText
  72.      */
  73.     public function setIsActive($isActive)
  74.     {
  75.         $this->isActive $isActive;
  76.         return $this;
  77.     }
  78.     /**
  79.      * Get isActive
  80.      *
  81.      * @return boolean
  82.      */
  83.     public function getIsActive()
  84.     {
  85.         return $this->isActive;
  86.     }
  87.     /**
  88.      * Set termText
  89.      *
  90.      * @param string $termText
  91.      *
  92.      * @return TermText
  93.      */
  94.     public function setTermText($termText)
  95.     {
  96.         $this->termText $termText;
  97.         return $this;
  98.     }
  99.     /**
  100.      * Get termText
  101.      *
  102.      * @return string
  103.      */
  104.     public function getTermText()
  105.     {
  106.         return $this->termText;
  107.     }
  108.     /**
  109.      * Set createdAt
  110.      *
  111.      * @param \DateTime $createdAt
  112.      *
  113.      * @return TermText
  114.      */
  115.     public function setCreatedAt($createdAt)
  116.     {
  117.         $this->createdAt $createdAt;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get createdAt
  122.      *
  123.      * @return \DateTime
  124.      */
  125.     public function getCreatedAt()
  126.     {
  127.         return $this->createdAt;
  128.     }
  129.     /**
  130.      * Set term
  131.      *
  132.      * @param \App\Entity\Gos\Term $term
  133.      *
  134.      * @return TermText
  135.      */
  136.     public function setTerm(\App\Entity\Gos\Term $term null)
  137.     {
  138.         $this->term $term;
  139.         return $this;
  140.     }
  141.     /**
  142.      * Get term
  143.      *
  144.      * @return \App\Entity\Gos\Term
  145.      */
  146.     public function getTerm()
  147.     {
  148.         return $this->term;
  149.     }
  150.     /**
  151.      * Set activeTerm
  152.      *
  153.      * @param \App\Entity\Gos\Term $activeTerm
  154.      *
  155.      * @return TermText
  156.      */
  157.     public function setActiveTerm(\App\Entity\Gos\Term $activeTerm null)
  158.     {
  159.         $this->activeTerm $activeTerm;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get activeTerm
  164.      *
  165.      * @return \App\Entity\Gos\Term
  166.      */
  167.     public function getActiveTerm()
  168.     {
  169.         return $this->activeTerm;
  170.     }
  171.     /**
  172.      * Constructor
  173.      */
  174.     public function __construct()
  175.     {
  176.         $this->userTerms = new \Doctrine\Common\Collections\ArrayCollection();
  177.     }
  178.     /**
  179.      * Add userTerm
  180.      *
  181.      * @param \App\Entity\Gos\UserTerms $userTerm
  182.      *
  183.      * @return TermText
  184.      */
  185.     public function addUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  186.     {
  187.         $this->userTerms[] = $userTerm;
  188.         return $this;
  189.     }
  190.     /**
  191.      * Remove userTerm
  192.      *
  193.      * @param \App\Entity\Gos\UserTerms $userTerm
  194.      */
  195.     public function removeUserTerm(\App\Entity\Gos\UserTerms $userTerm)
  196.     {
  197.         $this->userTerms->removeElement($userTerm);
  198.     }
  199.     /**
  200.      * Get userTerms
  201.      *
  202.      * @return \Doctrine\Common\Collections\Collection
  203.      */
  204.     public function getUserTerms()
  205.     {
  206.         return $this->userTerms;
  207.     }
  208. }