<?php
/**
 * Trait implementing Taggable Content Interface
 *
 * @author Elze Kool <info@visualmedia.nl>
 */

namespace VisualM\TagManagerBundle\Content;

use VisualM\TagManagerBundle\Model\MetaTagCollection;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Trait implementing Taggable Content Interface
 */
trait TaggableContentTrait
{
    /**
     * MetaTagCollection
     * @var MetaTagCollection
     * @Assert\Valid()
     */
    protected $metaTagCollection;
    
    /**
     * Get Id
     * 
     * @return mixed Id
     */
    public abstract function getId();

    
    /**
     * Get unique ContentId
     *
     * @return string ContentId
     */
    public function getContentId()
    {
        if ($this->getId() === null) {
            return null;
        } else {
            return str_replace('Proxies\\__CG__\\', '', get_class($this)) . '#' . $this->getId();
        }
    }
    
    /**
     * Get MetaTagCollection
     *
     * @return MetaTagCollection MetaTagCollection
     **/
    public function getMetaTagCollection()
    {
        return $this->metaTagCollection;
    }

    /**
     * Set MetaTagCollection
     *
     * @param MetaTagCollection $metaTagCollection MetaTagCollection
     *
     * @return void
     **/
    public function setMetaTagCollection($metaTagCollection)
    {
        $this->metaTagCollection = $metaTagCollection;
    }

}
