src/Notaris/AdminBundle/Entity/Glossary.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: lisavandaele
  5.  * Date: 30/01/15
  6.  * Time: 12:53
  7.  */
  8. namespace Notaris\AdminBundle\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13.  * @ORM\Entity(repositoryClass="GlossaryRepository")
  14.  * @ORM\Table(name="glossary")
  15.  */
  16. class Glossary {
  17.     /**
  18.      * @var integer
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="Notaris\AdminBundle\Entity\User")
  27.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
  28.      */
  29.     private $user;
  30.     /**
  31.      * @Gedmo\Timestampable(on="create")
  32.      * @ORM\Column(name="created", type="datetime")
  33.      */
  34.     private $created;
  35.     /**
  36.      * @ORM\Column(name="updated", type="datetime")
  37.      * @Gedmo\Timestampable(on="update")
  38.      */
  39.     private $updated;
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="locale", type="string", length=5)
  44.      */
  45.     private $locale;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(name="term", type="string", length=255)
  50.      */
  51.     private $term;
  52.     /**
  53.      * @ORM\Column(type="text", name="description")
  54.      */
  55.     private $description;
  56.     /**
  57.      * @ORM\Column(type="boolean", name="is_active")
  58.      * @Assert\Type("boolean")
  59.      */
  60.     private $isActive;
  61.     /**
  62.      * @ORM\Column(name="pub_date", type="datetime")
  63.      */
  64.     private $publicationDate;
  65.     /**
  66.      * @ORM\Column(type="string", name="letter", length=1, options={"fixed" = true})
  67.      */
  68.     private $letter;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity="Subsite")
  71.      * @ORM\JoinTable(name="glossary_subsite")
  72.      * @ORM\OrderBy({"position" = "asc"})
  73.      */
  74.     protected $subsites;
  75.     /**
  76.      * @ORM\ManyToMany(targetEntity="Tag", inversedBy="glossaries")
  77.      * @ORM\JoinTable(name="tag_glossary")
  78.      */
  79.     private $tags;
  80.     /**
  81.      * @Gedmo\Slug(fields={"term"})
  82.      * @ORM\Column(length=128, unique=true)
  83.      */
  84.     private $slug;
  85.     /**
  86.      * Constructor
  87.      */
  88.     public function __construct()
  89.     {
  90.         $this->subsites = new \Doctrine\Common\Collections\ArrayCollection();
  91.         $this->tags = new \Doctrine\Common\Collections\ArrayCollection();
  92.     }
  93.     /**
  94.      * Get id
  95.      *
  96.      * @return integer 
  97.      */
  98.     public function getId()
  99.     {
  100.         return $this->id;
  101.     }
  102.     /**
  103.      * Set created
  104.      *
  105.      * @param \DateTime $created
  106.      * @return Glossary
  107.      */
  108.     public function setCreated($created)
  109.     {
  110.         $this->created = $created;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get created
  115.      *
  116.      * @return \DateTime 
  117.      */
  118.     public function getCreated()
  119.     {
  120.         return $this->created;
  121.     }
  122.     /**
  123.      * Set updated
  124.      *
  125.      * @param \DateTime $updated
  126.      * @return Glossary
  127.      */
  128.     public function setUpdated($updated)
  129.     {
  130.         $this->updated = $updated;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get updated
  135.      *
  136.      * @return \DateTime 
  137.      */
  138.     public function getUpdated()
  139.     {
  140.         return $this->updated;
  141.     }
  142.     /**
  143.      * Set locale
  144.      *
  145.      * @param string $locale
  146.      * @return Glossary
  147.      */
  148.     public function setLocale($locale)
  149.     {
  150.         $this->locale = $locale;
  151.         return $this;
  152.     }
  153.     /**
  154.      * Get locale
  155.      *
  156.      * @return string 
  157.      */
  158.     public function getLocale()
  159.     {
  160.         return $this->locale;
  161.     }
  162.     /**
  163.      * Set term
  164.      *
  165.      * @param string $term
  166.      * @return Glossary
  167.      */
  168.     public function setTerm($term)
  169.     {
  170.         $this->term = $term;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Get term
  175.      *
  176.      * @return string 
  177.      */
  178.     public function getTerm()
  179.     {
  180.         return $this->term;
  181.     }
  182.     /**
  183.      * Set description
  184.      *
  185.      * @param string $description
  186.      * @return Glossary
  187.      */
  188.     public function setDescription($description)
  189.     {
  190.         $this->description = $description;
  191.         return $this;
  192.     }
  193.     /**
  194.      * Get description
  195.      *
  196.      * @return string 
  197.      */
  198.     public function getDescription()
  199.     {
  200.         return $this->description;
  201.     }
  202.     /**
  203.      * Set isActive
  204.      *
  205.      * @param boolean $isActive
  206.      * @return Glossary
  207.      */
  208.     public function setIsActive($isActive)
  209.     {
  210.         $this->isActive = $isActive;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get isActive
  215.      *
  216.      * @return boolean 
  217.      */
  218.     public function getIsActive()
  219.     {
  220.         return $this->isActive;
  221.     }
  222.     /**
  223.      * Set publicationDate
  224.      *
  225.      * @param \DateTime $publicationDate
  226.      * @return Glossary
  227.      */
  228.     public function setPublicationDate($publicationDate)
  229.     {
  230.         $this->publicationDate = $publicationDate;
  231.         return $this;
  232.     }
  233.     /**
  234.      * Get publicationDate
  235.      *
  236.      * @return \DateTime 
  237.      */
  238.     public function getPublicationDate()
  239.     {
  240.         return $this->publicationDate;
  241.     }
  242.     /**
  243.      * Set letter
  244.      *
  245.      * @param string $letter
  246.      * @return Glossary
  247.      */
  248.     public function setLetter($letter)
  249.     {
  250.         $this->letter = $letter;
  251.         return $this;
  252.     }
  253.     /**
  254.      * Get letter
  255.      *
  256.      * @return string 
  257.      */
  258.     public function getLetter()
  259.     {
  260.         return $this->letter;
  261.     }
  262.     /**
  263.      * Set user
  264.      *
  265.      * @param \Notaris\AdminBundle\Entity\User $user
  266.      * @return Glossary
  267.      */
  268.     public function setUser(\Notaris\AdminBundle\Entity\User $user = null)
  269.     {
  270.         $this->user = $user;
  271.         return $this;
  272.     }
  273.     /**
  274.      * Get user
  275.      *
  276.      * @return \Notaris\AdminBundle\Entity\User 
  277.      */
  278.     public function getUser()
  279.     {
  280.         return $this->user;
  281.     }
  282.     /**
  283.      * Add tags
  284.      *
  285.      * @param \Notaris\AdminBundle\Entity\Tag $tags
  286.      * @return Glossary
  287.      */
  288.     public function addTag(\Notaris\AdminBundle\Entity\Tag $tags)
  289.     {
  290.         $this->tags[] = $tags;
  291.         return $this;
  292.     }
  293.     /**
  294.      * Remove tags
  295.      *
  296.      * @param \Notaris\AdminBundle\Entity\Tag $tags
  297.      */
  298.     public function removeTag(\Notaris\AdminBundle\Entity\Tag $tags)
  299.     {
  300.         $this->tags->removeElement($tags);
  301.     }
  302.     /**
  303.      * Get tags
  304.      *
  305.      * @return \Doctrine\Common\Collections\Collection 
  306.      */
  307.     public function getTags()
  308.     {
  309.         return $this->tags;
  310.     }
  311.     /**
  312.      * Add subsites
  313.      *
  314.      * @param \Notaris\AdminBundle\Entity\Subsite $subsites
  315.      * @return Glossary
  316.      */
  317.     public function addSubsite(\Notaris\AdminBundle\Entity\Subsite $subsites)
  318.     {
  319.         $this->subsites[] = $subsites;
  320.         return $this;
  321.     }
  322.     /**
  323.      * Remove subsites
  324.      *
  325.      * @param \Notaris\AdminBundle\Entity\Subsite $subsites
  326.      */
  327.     public function removeSubsite(\Notaris\AdminBundle\Entity\Subsite $subsites)
  328.     {
  329.         $this->subsites->removeElement($subsites);
  330.     }
  331.     /**
  332.      * Get subsites
  333.      *
  334.      * @return \Doctrine\Common\Collections\Collection 
  335.      */
  336.     public function getSubsites()
  337.     {
  338.         return $this->subsites;
  339.     }
  340.     /**
  341.      * Set slug
  342.      *
  343.      * @param string $slug
  344.      * @return Glossary
  345.      */
  346.     public function setSlug($slug)
  347.     {
  348.         $this->slug = $slug;
  349.         return $this;
  350.     }
  351.     /**
  352.      * Get slug
  353.      *
  354.      * @return string 
  355.      */
  356.     public function getSlug()
  357.     {
  358.         return $this->slug;
  359.     }
  360. }