<?php

namespace App\Entity;

use App\Repository\StateRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: StateRepository::class)]
class State
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(type: Types::SMALLINT)]
    private ?int $step = null;

    #[ORM\Column(type: Types::SMALLINT)]
    private ?int $progress = null;

    #[ORM\Column]
    private ?\DateTime $date = null;

    #[ORM\Column(nullable: true)]
    private ?array $detail = null;

    #[ORM\ManyToOne(inversedBy: 'states', cascade: ['persist'])]
    #[ORM\JoinColumn(nullable: false)]
    private ?Investigation $investigation = null;

    #[ORM\ManyToOne(inversedBy: 'states')]
    private ?Broadcast $broadcast = null;

    public function __construct()
    {
        $this->date = new \DateTime();
    }

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

    public function getStep(): ?int
    {
        return $this->step;
    }

    public function setStep(int $step): static
    {
        $this->step = $step;

        return $this;
    }

    public function getProgress(): ?int
    {
        return $this->progress;
    }

    public function setProgress(int $progress): static
    {
        $this->progress = $progress;

        return $this;
    }

    public function getDate(): ?\DateTime
    {
        return $this->date;
    }

    public function setDate(\DateTime $date): static
    {
        $this->date = $date;

        return $this;
    }

    public function getDetail(): ?array
    {
        return $this->detail;
    }

    public function setDetail(?array $detail): static
    {
        $this->detail = $detail;

        return $this;
    }

    public function getInvestigation(): ?Investigation
    {
        return $this->investigation;
    }

    public function setInvestigation(?Investigation $investigation): static
    {
        $this->investigation = $investigation;

        return $this;
    }

    public function getBroadcast(): ?Broadcast
    {
        return $this->broadcast;
    }

    public function setBroadcast(?Broadcast $broadcast): static
    {
        $this->broadcast = $broadcast;

        return $this;
    }
}
