<?php

namespace OSEF\AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use OSEF\CommonBundle\Traits\DoctrineBehaviors as OSEFDB;

/**
 * Article
 *
 * @ORM\Table(name="article")
 * @ORM\Entity(repositoryClass="OSEF\AppBundle\Entity\ArticleRepository")
 */
class Article
{
    use OSEFDB\Id,
        ORMBehaviors\Timestampable\Timestampable,
        ORMBehaviors\Sluggable\Sluggable
    ;

    /**
     * @var string
     *
     * @ORM\Column(name="title", type="string", length=255)
     */
    private $title;

    /**
     * @var string
     *
     * @ORM\Column(name="content", type="text")
     */
    private $content;


    /**
     * Set title
     *
     * @param string $title
     * @return Article
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set content
     *
     * @param string $content
     * @return Article
     */
    public function setContent($content)
    {
        $this->content = $content;

        return $this;
    }

    /**
     * Get content
     *
     * @return string 
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * @return array
     */
    public function getSluggableFields()
    {
        return ['title'];
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->getTitle();
    }
}
