<?php
/**
 * MetaTagSet Entity
 * 
 * @author Elze Kool <info@visualmedia.nl>
 */
namespace VisualM\TagManagerBundle\Entity;

use VisualM\TagManagerBundle\Model\MetaTagSetModel;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * MetaTagSet Entity
 *
 * @ORM\Entity(repositoryClass="MetaTagSetRepository")
 * @ORM\Table(name="meta_tag_set")
 *
 * @author Elze Kool <info@visualmedia.nl>
 */
class MetaTagSet extends MetaTagSetModel
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(name="naam", type="string", nullable = false)
     * @Assert\NotBlank(message = "meta_tag_set.naam.not_blank")
     */
    protected $naam;

    /**
     * @ORM\Column(name="kiesbaar", type="boolean", nullable = false)
     * @Assert\NotNull(message = "meta_tag_set.kiesbaar.not_blank")
     */
    protected $kiesbaar = true;

    /**
     * @ORM\Column(name="content_types", type="simple_array", nullable = true)
     */
    protected $contentTypes = [];

    /**
     * @ORM\Column(name="factory_service", type="string", length=255, nullable = true)
     */
    private $factoryService;

    /**
     * @ORM\Column(name="factory_configuration", type="json_array", nullable = true)
     */
    private $factoryConfiguration;

    /**
     * @ORM\OneToMany(targetEntity="MetaTagPreset", mappedBy="metaTagSet", orphanRemoval=true)
     * @Assert\Valid
     * @var ArrayCollection
     */
    protected $metaTagPresets;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->metaTagPresets = new ArrayCollection();
        $this->factoryService = 'visualm.tag_manager.tagset.generic.factory';
    }

    /**
     * Get Id
     *
     * @return int Id
     **/
    public function getId()
    {
        return $this->id;
    }

    /**
     * Get Naam
     *
     * @return string Naam
     **/
    public function getNaam()
    {
        return $this->naam;
    }

    /**
     * Set Naam
     *
     * @param string $naam Naam
     *
     * @return void
     **/
    public function setNaam($naam)
    {
        $this->naam = $naam;
    }

    /**
     * Get Kiesbaar
     *
     * @return bool Kiesbaar
     **/
    public function getKiesbaar()
    {
        return $this->kiesbaar;
    }

    /**
     * Set Kiesbaar
     *
     * @param bool $kiesbaar Kiesbaar
     *
     * @return void
     **/
    public function setKiesbaar($kiesbaar)
    {
        $this->kiesbaar = $kiesbaar;
    }

    /**
     * Get Content Types
     *
     * @return array Content Types
     **/
    public function getContentTypes()
    {
        return $this->contentTypes;
    }

    /**
     * Set Content Types
     *
     * @param array $contentTypes Content Types
     *
     * @return void
     **/
    public function setContentTypes($contentTypes)
    {
        $this->contentTypes = $contentTypes;
    }

    /**
     * Get MetaTag Presets
     *
     * @return ArrayCollection MetaTag Presets
     **/
    public function getMetaTagPresets()
    {
        return $this->metaTagPresets;
    }

    /**
     * Get Factory Service
     *
     * @return string
     **/
    public function getFactoryService()
    {
        return $this->factoryService;
    }

    /**
     * Set Factory Service
     *
     * @param string $factoryService
     *
     * @return void
     **/
    public function setFactoryService($factoryService)
    {
        $this->factoryService = $factoryService;
    }

    /**
     * Set MetaTag Presets
     *
     * @param ArrayCollection $metaTagPresets MetaTag Presets
     *
     * @return void
     **/
    public function setMetaTagPresets($metaTagPresets)
    {
        $this->metaTagPresets = $metaTagPresets;
    }

    /**
     * Get Factory Configuration
     *
     * @return array Factory Configuration
     **/
    public function getFactoryConfiguration()
    {
        return $this->factoryConfiguration;
    }

    /**
     * Set Factory Configuration
     *
     * @param array $factoryConfiguration Factory Configuration
     *
     * @return void
     **/
    public function setFactoryConfiguration($factoryConfiguration)
    {
        $this->factoryConfiguration = $factoryConfiguration;
    }
}
