<?php

namespace App\Entity\Research;

use App\Entity\BroadcastableInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity()
 * @ORM\Table(name="research_status")
 */
class Status implements BroadcastableInterface
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=50)
     * @Assert\NotBlank()
     */
    private $title;

    /**
     * @ORM\Column(type="integer", nullable=true, options={"default": 0})
     */
    private $orderLvl;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $options;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getTitle(): ?string
    {
        return $this->title;
    }

    public function setTitle(?string $title): self
    {
        $this->title = $title;

        return $this;
    }

    public function getOrderLvl(): ?int
    {
        return $this->orderLvl;
    }

    public function setOrderLvl(int $orderLvl): self
    {
        $this->orderLvl = $orderLvl;

        return $this;
    }

    public function getOptions(): ?array
    {
        return json_decode($this->options, true);
    }

    public function setOptions(string $options): self
    {
        $this->options = $options;

        return $this;
    }

    public function getDataType(): string
    {
        return 'researchstatus';
    }
}
