<?php

namespace Lc\SovBundle\Model\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
 * @ORM\MappedSuperclass()
 */
abstract class TicketMessageModel extends AbstractLightEntity implements TicketMessageInterface, EntityInterface, StatusInterface
{
    use StatusTrait;

    /**
     * @ORM\Column(type="text")
     */
    protected $message;

    /**
     * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Ticket\TicketInterface", inversedBy="ticketMessages")
     * @ORM\JoinColumn(nullable=false)
     */
    protected $ticket;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    protected $answerByAdmin;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    protected $imageFilename;

    public function __toString()
    {
        return ''.$this->message;
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function setMessage(string $message): self
    {
        $this->message = $message;

        return $this;
    }

    public function getTicket(): TicketInterface
    {
        return $this->ticket;
    }

    public function setTicket(TicketInterface $ticket): self
    {
        $this->ticket = $ticket;

        return $this;
    }

    public function getAnswerByAdmin(): ?bool
    {
        return $this->answerByAdmin;
    }

    public function setAnswerByAdmin(?bool $answerByAdmin): self
    {
        $this->answerByAdmin = $answerByAdmin;

        return $this;
    }

    public function getImageFilename(): ?string
    {
        return $this->imageFilename;
    }

    public function setImageFilename(?string $imageFilename): self
    {
        $this->imageFilename = $imageFilename;

        return $this;
    }
}
