<?php
namespace IUTUDC\WebsiteBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* SliderConfig
*
* @ORM\Table(name="iutudc_websitebundle_slider_configs")
* @ORM\Entity(repositoryClass="IUTUDC\WebsiteBundle\Repository\SliderConfigRepository")
*/
class SliderConfig extends \Kunstmaan\ConfigBundle\Entity\AbstractConfig
{
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="\IUTUDC\WebsiteBundle\Entity\SliderItem", mappedBy="sliderConfig", cascade={"persist", "remove"}, orphanRemoval=true)
**/
private $sliderItems;
/**
* Constructor
*/
public function __construct()
{
$this->sliderItems = new ArrayCollection();
}
/**
* @param ArrayCollection $sliderItems
*/
public function setSliderItems($sliderItems)
{
$this->sliderItems = $sliderItems;
}
/**
* @return ArrayCollection
*/
public function getSliderItems()
{
return $this->sliderItems;
}
/**
* @param \IUTUDC\WebsiteBundle\Entity\SliderItem $sliderItem
*/
public function addSliderItem(\IUTUDC\WebsiteBundle\Entity\SliderItem $sliderItem)
{
if (!$this->sliderItems->contains($sliderItem)) {
$this->sliderItems[] = $sliderItem;
$sliderItem->setSliderConfig($this);
}
return $this;
}
/**
* @param \IUTUDC\WebsiteBundle\Entity\SliderItem $sliderItem
*/
public function removeSliderItem(\IUTUDC\WebsiteBundle\Entity\SliderItem $sliderItem)
{
$this->sliderItems->removeElement($sliderItem);
}
/**
* This function is optional. Implement it if you would like a other ROLE to access the configuration section.
**/
public function getRoles()
{
return array('ROLE_ADMIN');
}
/**
* Returns the form type to use for this configuratble entity.
*
* @return string
*/
public function getDefaultAdminType()
{
return 'IUTUDC\WebsiteBundle\Form\SliderConfigAdminType';
}
/**
* The internal name will be used as unique id for the route etc.
*
* Use a name with no spaces but with underscores.
*
* @return string
*/
public function getInternalName()
{
return 'sliderconfig';
}
/**
* Returns the label for the menu item that will be created.
*
* @return string
*/
public function getLabel()
{
return 'Configuration du slider';
}
}