<?php

namespace AppBundle\Entity;

use AppBundle\Utils\Traits\IsVisibleTrait;
use AppBundle\Utils\Traits\StatusTrait;
use AppBundle\Utils\Traits\TimestampableTrait;
use Doctrine\ORM\Mapping as ORM;

/**
 * Recommendation
 *
 * @ORM\Table(name="recommendation")
 * @ORM\Entity()
 * @ORM\HasLifecycleCallbacks()
 */
class Recommendation
{

    use TimestampableTrait;
    use StatusTrait;
    use IsVisibleTrait;

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="sendedRecommendations", cascade={"persist"})
     */
    private $sender;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="recommendations", cascade={"persist"})
     */
    private $user;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Media", inversedBy="answers", cascade={"persist"})
     */
    private $video;

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

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

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_enabled", type="boolean", nullable=true, options={"comment":"visible sur la page du talent"})
     */
    private $isEnabled;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_removed", type="boolean", nullable=true, options={"comment":"supprimee par l'envoyeur"})
     */
    private $isRemoved;

    /**
     * @var string
     *
     * @ORM\Column(name="remove_message", type="text", nullable=true)
     */
    private $removeMessage;

    /***********************
     * Constructor
     ***********************/

    public function __construct($user = null, $sender = null)
    {
        $this->user = $user;
        $this->sender = $sender;
        $this->isVisible = true;
        $this->isRemoved = false;
        $this->isEnabled = false;
    }

    /***********************
     * Custom Functions
     ***********************/

    //Write custom function here

    /***********************
     * Getters & Setters
     ***********************/

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

    /**
     * Get the value of sender
     */
    public function getSender()
    {
        return $this->sender;
    }

    /**
     * Set the value of sender
     *
     * @return  self
     */
    public function setSender($sender)
    {
        $this->sender = $sender;

        return $this;
    }

    /**
     * Get the value of user
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set the value of user
     *
     * @return  self
     */
    public function setUser($user)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get the value of video
     */
    public function getVideo()
    {
        return $this->video;
    }

    /**
     * Set the value of video
     *
     * @return  self
     */
    public function setVideo($video)
    {
        $this->video = $video;

        return $this;
    }

    /**
     * Get the value of message
     *
     * @return  string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * Set the value of message
     *
     * @param  string  $message
     *
     * @return  self
     */
    public function setMessage(string $message)
    {
        $this->message = $message;

        return $this;
    }

    /**
     * Get the value of relationType
     *
     * @return  string
     */
    public function getRelationType()
    {
        return $this->relationType;
    }

    /**
     * Set the value of relationType
     *
     * @param  string  $relationType
     *
     * @return  self
     */
    public function setRelationType(string $relationType)
    {
        $this->relationType = $relationType;

        return $this;
    }

    /**
     * Get the value of isEnabled
     *
     * @return  boolean
     */
    public function getIsEnabled()
    {
        return $this->isEnabled;
    }

    /**
     * Set the value of isEnabled
     *
     * @param  boolean  $isEnabled
     *
     * @return  self
     */
    public function setIsEnabled($isEnabled)
    {
        $this->isEnabled = $isEnabled;

        return $this;
    }

    /**
     * Get the value of isRemoved
     *
     * @return  boolean
     */
    public function getIsRemoved()
    {
        return $this->isRemoved;
    }

    /**
     * Set the value of isRemoved
     *
     * @param  boolean  $isRemoved
     *
     * @return  self
     */
    public function setIsRemoved($isRemoved)
    {
        $this->isRemoved = $isRemoved;

        return $this;
    }

    /**
     * Get the value of removeMessage
     *
     * @return  string
     */
    public function getRemoveMessage()
    {
        return $this->removeMessage;
    }

    /**
     * Set the value of removeMessage
     *
     * @param  string  $removeMessage
     *
     * @return  self
     */
    public function setRemoveMessage(string $removeMessage)
    {
        $this->removeMessage = $removeMessage;

        return $this;
    }
}
