<?php
/**
* Created by PhpStorm.
* User: lisavandaele
* Date: 30/01/15
* Time: 12:53
*/
namespace Notaris\AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="GlossaryRepository")
* @ORM\Table(name="glossary")
*/
class Glossary {
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="Notaris\AdminBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $user;
/**
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created", type="datetime")
*/
private $created;
/**
* @ORM\Column(name="updated", type="datetime")
* @Gedmo\Timestampable(on="update")
*/
private $updated;
/**
* @var string
*
* @ORM\Column(name="locale", type="string", length=5)
*/
private $locale;
/**
* @var string
*
* @ORM\Column(name="term", type="string", length=255)
*/
private $term;
/**
* @ORM\Column(type="text", name="description")
*/
private $description;
/**
* @ORM\Column(type="boolean", name="is_active")
* @Assert\Type("boolean")
*/
private $isActive;
/**
* @ORM\Column(name="pub_date", type="datetime")
*/
private $publicationDate;
/**
* @ORM\Column(type="string", name="letter", length=1, options={"fixed" = true})
*/
private $letter;
/**
* @ORM\ManyToMany(targetEntity="Subsite")
* @ORM\JoinTable(name="glossary_subsite")
* @ORM\OrderBy({"position" = "asc"})
*/
protected $subsites;
/**
* @ORM\ManyToMany(targetEntity="Tag", inversedBy="glossaries")
* @ORM\JoinTable(name="tag_glossary")
*/
private $tags;
/**
* @Gedmo\Slug(fields={"term"})
* @ORM\Column(length=128, unique=true)
*/
private $slug;
/**
* Constructor
*/
public function __construct()
{
$this->subsites = new \Doctrine\Common\Collections\ArrayCollection();
$this->tags = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set created
*
* @param \DateTime $created
* @return Glossary
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set updated
*
* @param \DateTime $updated
* @return Glossary
*/
public function setUpdated($updated)
{
$this->updated = $updated;
return $this;
}
/**
* Get updated
*
* @return \DateTime
*/
public function getUpdated()
{
return $this->updated;
}
/**
* Set locale
*
* @param string $locale
* @return Glossary
*/
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
/**
* Get locale
*
* @return string
*/
public function getLocale()
{
return $this->locale;
}
/**
* Set term
*
* @param string $term
* @return Glossary
*/
public function setTerm($term)
{
$this->term = $term;
return $this;
}
/**
* Get term
*
* @return string
*/
public function getTerm()
{
return $this->term;
}
/**
* Set description
*
* @param string $description
* @return Glossary
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set isActive
*
* @param boolean $isActive
* @return Glossary
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get isActive
*
* @return boolean
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set publicationDate
*
* @param \DateTime $publicationDate
* @return Glossary
*/
public function setPublicationDate($publicationDate)
{
$this->publicationDate = $publicationDate;
return $this;
}
/**
* Get publicationDate
*
* @return \DateTime
*/
public function getPublicationDate()
{
return $this->publicationDate;
}
/**
* Set letter
*
* @param string $letter
* @return Glossary
*/
public function setLetter($letter)
{
$this->letter = $letter;
return $this;
}
/**
* Get letter
*
* @return string
*/
public function getLetter()
{
return $this->letter;
}
/**
* Set user
*
* @param \Notaris\AdminBundle\Entity\User $user
* @return Glossary
*/
public function setUser(\Notaris\AdminBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \Notaris\AdminBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Add tags
*
* @param \Notaris\AdminBundle\Entity\Tag $tags
* @return Glossary
*/
public function addTag(\Notaris\AdminBundle\Entity\Tag $tags)
{
$this->tags[] = $tags;
return $this;
}
/**
* Remove tags
*
* @param \Notaris\AdminBundle\Entity\Tag $tags
*/
public function removeTag(\Notaris\AdminBundle\Entity\Tag $tags)
{
$this->tags->removeElement($tags);
}
/**
* Get tags
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTags()
{
return $this->tags;
}
/**
* Add subsites
*
* @param \Notaris\AdminBundle\Entity\Subsite $subsites
* @return Glossary
*/
public function addSubsite(\Notaris\AdminBundle\Entity\Subsite $subsites)
{
$this->subsites[] = $subsites;
return $this;
}
/**
* Remove subsites
*
* @param \Notaris\AdminBundle\Entity\Subsite $subsites
*/
public function removeSubsite(\Notaris\AdminBundle\Entity\Subsite $subsites)
{
$this->subsites->removeElement($subsites);
}
/**
* Get subsites
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSubsites()
{
return $this->subsites;
}
/**
* Set slug
*
* @param string $slug
* @return Glossary
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
}