src/Notaris/AdminBundle/Entity/Subsite.php line 20

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="SubsiteRepository")
  14.  * @ORM\Table(name="subsite",uniqueConstraints={
  15.  *     @ORM\UniqueConstraint(name="unique_subsite", columns={"slug", "locale"})})
  16.  */
  17. class Subsite {
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="locale", type="string", length=5)
  30.      */
  31.     private $locale;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="name", type="string", length=255)
  36.      */
  37.     private $name;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="slug", type="string", length=255)
  42.      */
  43.     private $slug;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="stylesheet", type="string", length=255)
  48.      */
  49.     private $stylesheet;
  50.     /**
  51.      * @ORM\Column(type="boolean", name="in_main_nav")
  52.      * @Assert\Type("boolean")
  53.      */
  54.     private $inMainNav;
  55.     /**
  56.      * @ORM\Column(type="boolean", name="is_active")
  57.      * @Assert\Type("boolean")
  58.      */
  59.     private $isActive;
  60.     /**
  61.      * @var integer
  62.      *
  63.      * @ORM\Column(type="integer")
  64.      */
  65.     private $position = 0;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="oneliner", type="string", length=255)
  70.      */
  71.     private $oneliner;
  72.     /**
  73.      * @ORM\Column(type="text", name="welcome_text")
  74.      */
  75.     private $welcomeText;
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="directory", type="string", length=255)
  80.      */
  81.     private $directory;
  82.     /**
  83.      * @var string
  84.      *
  85.      * @ORM\Column(name="page_title", type="string", length=255)
  86.      */
  87.     private $pageTitle;
  88.     /**
  89.      * @ORM\Column(name="type", type="string", columnDefinition="enum('home', 'news','job','faq','immo','conditions','calculate','lang')", nullable=true)
  90.      */
  91.     private $type;
  92.     /**
  93.      * @ORM\OneToOne(targetEntity="Meta")
  94.      * @ORM\JoinColumn(name="meta_id", referencedColumnName="id")
  95.      */
  96.     protected $meta;
  97.     /**
  98.      * @ORM\OneToMany(targetEntity="Section", mappedBy="subsite")
  99.      * @ORM\OrderBy({"position" = "ASC"})
  100.      */
  101.     private $sections;
  102.     /**
  103.      * @ORM\OneToMany(targetEntity="SubsiteBanner", mappedBy="subsite")
  104.      * @ORM\OrderBy({"position" = "ASC"})
  105.      */
  106.     protected $banners;
  107.     /**
  108.      * @ORM\OneToOne(targetEntity="Subsite")
  109.      * @ORM\JoinColumn(name="language_link_subsite_id", referencedColumnName="id", nullable=true)
  110.      */
  111.     protected $languageLinkSubsite;
  112.     /**
  113.      * Get id
  114.      *
  115.      * @return integer
  116.      */
  117.     public function getId()
  118.     {
  119.         return $this->id;
  120.     }
  121.     /**
  122.      * Set locale
  123.      *
  124.      * @param string $locale
  125.      * @return Subsite
  126.      */
  127.     public function setLocale($locale)
  128.     {
  129.         $this->locale = $locale;
  130.         return $this;
  131.     }
  132.     /**
  133.      * Get locale
  134.      *
  135.      * @return string
  136.      */
  137.     public function getLocale()
  138.     {
  139.         return $this->locale;
  140.     }
  141.     /**
  142.      * Set name
  143.      *
  144.      * @param string $name
  145.      * @return Subsite
  146.      */
  147.     public function setName($name)
  148.     {
  149.         $this->name = $name;
  150.         return $this;
  151.     }
  152.     /**
  153.      * Get name
  154.      *
  155.      * @return string
  156.      */
  157.     public function getName()
  158.     {
  159.         return $this->name;
  160.     }
  161.     /**
  162.      * Set slug
  163.      *
  164.      * @param string $slug
  165.      * @return Subsite
  166.      */
  167.     public function setSlug($slug)
  168.     {
  169.         $this->slug = $slug;
  170.         return $this;
  171.     }
  172.     /**
  173.      * Get slug
  174.      *
  175.      * @return string
  176.      */
  177.     public function getSlug()
  178.     {
  179.         return $this->slug;
  180.     }
  181.     /**
  182.      * Set stylesheet
  183.      *
  184.      * @param string $stylesheet
  185.      * @return Subsite
  186.      */
  187.     public function setStylesheet($stylesheet)
  188.     {
  189.         $this->stylesheet = $stylesheet;
  190.         return $this;
  191.     }
  192.     /**
  193.      * Get stylesheet
  194.      *
  195.      * @return string
  196.      */
  197.     public function getStylesheet()
  198.     {
  199.         return $this->stylesheet;
  200.     }
  201.     /**
  202.      * Set inMainNav
  203.      *
  204.      * @param boolean $inMainNav
  205.      * @return Subsite
  206.      */
  207.     public function setInMainNav($inMainNav)
  208.     {
  209.         $this->inMainNav = $inMainNav;
  210.         return $this;
  211.     }
  212.     /**
  213.      * Get inMainNav
  214.      *
  215.      * @return boolean
  216.      */
  217.     public function getInMainNav()
  218.     {
  219.         return $this->inMainNav;
  220.     }
  221.     /**
  222.      * Set isActive
  223.      *
  224.      * @param boolean $isActive
  225.      * @return Subsite
  226.      */
  227.     public function setIsActive($isActive)
  228.     {
  229.         $this->isActive = $isActive;
  230.         return $this;
  231.     }
  232.     /**
  233.      * Get isActive
  234.      *
  235.      * @return boolean
  236.      */
  237.     public function getIsActive()
  238.     {
  239.         return $this->isActive;
  240.     }
  241.     /**
  242.      * Set position
  243.      *
  244.      * @param integer $position
  245.      * @return Subsite
  246.      */
  247.     public function setPosition($position)
  248.     {
  249.         $this->position = $position;
  250.         return $this;
  251.     }
  252.     /**
  253.      * Get position
  254.      *
  255.      * @return integer
  256.      */
  257.     public function getPosition()
  258.     {
  259.         return $this->position;
  260.     }
  261.     /**
  262.      * Set welcomeText
  263.      *
  264.      * @param string $welcomeText
  265.      * @return Subsite
  266.      */
  267.     public function setWelcomeText($welcomeText)
  268.     {
  269.         $this->welcomeText = $welcomeText;
  270.         return $this;
  271.     }
  272.     /**
  273.      * Get welcomeText
  274.      *
  275.      * @return string
  276.      */
  277.     public function getWelcomeText()
  278.     {
  279.         return $this->welcomeText;
  280.     }
  281.     /**
  282.      * Set directory
  283.      *
  284.      * @param string $directory
  285.      * @return Subsite
  286.      */
  287.     public function setDirectory($directory)
  288.     {
  289.         $this->directory = $directory;
  290.         return $this;
  291.     }
  292.     /**
  293.      * Get directory
  294.      *
  295.      * @return string
  296.      */
  297.     public function getDirectory()
  298.     {
  299.         return $this->directory;
  300.     }
  301.     /**
  302.      * @return string
  303.      */
  304.     public function getPageTitle()
  305.     {
  306.         return $this->pageTitle;
  307.     }
  308.     /**
  309.      * @param string $papgeTitle
  310.      */
  311.     public function setPageTitle($pageTitle)
  312.     {
  313.         $this->pageTitle = $pageTitle;
  314.     }
  315.     /**
  316.      * Set type
  317.      *
  318.      * @param string $type
  319.      * @return Subsite
  320.      */
  321.     public function setType($type)
  322.     {
  323.         $this->type = $type;
  324.         return $this;
  325.     }
  326.     /**
  327.      * Get type
  328.      *
  329.      * @return string
  330.      */
  331.     public function getType()
  332.     {
  333.         return $this->type;
  334.     }
  335.     /**
  336.      * Set meta
  337.      *
  338.      * @param \Notaris\AdminBundle\Entity\Meta $meta
  339.      * @return Subsite
  340.      */
  341.     public function setMeta(\Notaris\AdminBundle\Entity\Meta $meta = null)
  342.     {
  343.         $this->meta = $meta;
  344.         return $this;
  345.     }
  346.     /**
  347.      * Get meta
  348.      *
  349.      * @return \Notaris\AdminBundle\Entity\Meta
  350.      */
  351.     public function getMeta()
  352.     {
  353.         return $this->meta;
  354.     }
  355.     /**
  356.      * @return string
  357.      */
  358.     public function __toString(){
  359.         return $this->getName();
  360.     }
  361.     /**
  362.      * @return mixed
  363.      */
  364.     public function getSections()
  365.     {
  366.         return $this->sections;
  367.     }
  368.     /**
  369.      * @param mixed $sections
  370.      */
  371.     public function setSections($sections)
  372.     {
  373.         $this->sections = $sections;
  374.     }
  375.     /**
  376.      * @return mixed
  377.      */
  378.     public function getBanners()
  379.     {
  380.         return $this->banners;
  381.     }
  382.     /**
  383.      * @param mixed $banner
  384.      */
  385.     public function setBanners($banners)
  386.     {
  387.         $this->banners = $banners;
  388.     }
  389.     /**
  390.      * Constructor
  391.      */
  392.     public function __construct()
  393.     {
  394.         $this->sections = new \Doctrine\Common\Collections\ArrayCollection();
  395.         $this->banners = new \Doctrine\Common\Collections\ArrayCollection();
  396.     }
  397.     /**
  398.      * Add section
  399.      *
  400.      * @param \Notaris\AdminBundle\Entity\Section $section
  401.      *
  402.      * @return Subsite
  403.      */
  404.     public function addSection(\Notaris\AdminBundle\Entity\Section $section)
  405.     {
  406.         $this->sections[] = $section;
  407.         return $this;
  408.     }
  409.     /**
  410.      * Remove section
  411.      *
  412.      * @param \Notaris\AdminBundle\Entity\Section $section
  413.      */
  414.     public function removeSection(\Notaris\AdminBundle\Entity\Section $section)
  415.     {
  416.         $this->sections->removeElement($section);
  417.     }
  418.     /**
  419.      * Add banner
  420.      *
  421.      * @param \Notaris\AdminBundle\Entity\SubsiteBanner $banner
  422.      *
  423.      * @return Subsite
  424.      */
  425.     public function addBanner(\Notaris\AdminBundle\Entity\SubsiteBanner $banner)
  426.     {
  427.         $this->banners[] = $banner;
  428.         return $this;
  429.     }
  430.     /**
  431.      * Remove banner
  432.      *
  433.      * @param \Notaris\AdminBundle\Entity\SubsiteBanner $banner
  434.      */
  435.     public function removeBanner(\Notaris\AdminBundle\Entity\SubsiteBanner $banner)
  436.     {
  437.         $this->banners->removeElement($banner);
  438.     }
  439.     /**
  440.      * Set oneliner
  441.      *
  442.      * @param string $oneliner
  443.      *
  444.      * @return Subsite
  445.      */
  446.     public function setOneliner($oneliner)
  447.     {
  448.         $this->oneliner = $oneliner;
  449.         return $this;
  450.     }
  451.     /**
  452.      * Get oneliner
  453.      *
  454.      * @return string
  455.      */
  456.     public function getOneliner()
  457.     {
  458.         return $this->oneliner;
  459.     }
  460.     /**
  461.      * Set languageLinkSubsite
  462.      *
  463.      * @param \Notaris\AdminBundle\Entity\Subsite $languageLinkSubsite
  464.      * @return Subsite
  465.      */
  466.     public function setLanguageLinkSubsite(\Notaris\AdminBundle\Entity\Subsite $languageLinkSubsite = null)
  467.     {
  468.         $this->languageLinkSubsite = $languageLinkSubsite;
  469.         return $this;
  470.     }
  471.     /**
  472.      * Get languageLinkSubsite
  473.      *
  474.      * @return \Notaris\AdminBundle\Entity\Subsite
  475.      */
  476.     public function getLanguageLinkSubsite()
  477.     {
  478.         return $this->languageLinkSubsite;
  479.     }
  480. }