208 lines
4.1 KiB
PHP
208 lines
4.1 KiB
PHP
<?php
|
|
|
|
namespace App\Monitor\Framework\Entity;
|
|
|
|
use App\Monitor\Framework\Repository\MonitorRepository;
|
|
use App\User\Framework\Entity\User;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Attribute\Ignore;
|
|
use Symfony\UX\Turbo\Attribute\Broadcast;
|
|
|
|
#[Broadcast(template: 'broadcast/Monitor.stream.html.twig')]
|
|
#[ORM\Entity(repositoryClass: MonitorRepository::class)]
|
|
class Monitor
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[Ignore]
|
|
#[ORM\ManyToOne(inversedBy: 'yes')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?User $user = null;
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
private ?string $title = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $imdbId = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $tmdbId = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $monitorType = null;
|
|
|
|
#[ORM\Column(nullable: true)]
|
|
private ?int $season = null;
|
|
|
|
#[ORM\Column(nullable: true)]
|
|
private ?int $episode = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $status = null;
|
|
|
|
#[ORM\Column(nullable: true)]
|
|
private ?int $searchCount = null;
|
|
|
|
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
|
private ?\DateTimeInterface $lastSearch = null;
|
|
|
|
#[ORM\Column]
|
|
private ?\DateTimeImmutable $createdAt = null;
|
|
|
|
#[ORM\Column(nullable: true)]
|
|
private ?\DateTimeImmutable $downloadedAt = null;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getUser(): ?User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function setUser(?User $user): static
|
|
{
|
|
$this->user = $user;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getTitle(): ?string
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function setTitle(?string $title): static
|
|
{
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getImdbId(): ?string
|
|
{
|
|
return $this->imdbId;
|
|
}
|
|
|
|
public function setImdbId(string $imdbId): static
|
|
{
|
|
$this->imdbId = $imdbId;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getTmdbId(): ?string
|
|
{
|
|
return $this->tmdbId;
|
|
}
|
|
|
|
public function setTmdbId(string $tmdbId): static
|
|
{
|
|
$this->tmdbId = $tmdbId;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getStatus(): ?string
|
|
{
|
|
return $this->status;
|
|
}
|
|
|
|
public function setStatus(string $status): static
|
|
{
|
|
$this->status = $status;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSearchCount(): ?int
|
|
{
|
|
return $this->searchCount;
|
|
}
|
|
|
|
public function setSearchCount(?int $searchCount): static
|
|
{
|
|
$this->searchCount = $searchCount;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getLastSearch(): ?\DateTimeInterface
|
|
{
|
|
return $this->lastSearch;
|
|
}
|
|
|
|
public function setLastSearch(?\DateTimeInterface $lastSearch): static
|
|
{
|
|
$this->lastSearch = $lastSearch;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCreatedAt(): ?\DateTimeImmutable
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
public function setCreatedAt(\DateTimeImmutable $createdAt): static
|
|
{
|
|
$this->createdAt = $createdAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDownloadedAt(): ?\DateTimeImmutable
|
|
{
|
|
return $this->downloadedAt;
|
|
}
|
|
|
|
public function setDownloadedAt(?\DateTimeImmutable $downloadedAt): static
|
|
{
|
|
$this->downloadedAt = $downloadedAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getMonitorType(): ?string
|
|
{
|
|
return $this->monitorType;
|
|
}
|
|
|
|
public function setMonitorType(string $monitorType): static
|
|
{
|
|
$this->monitorType = $monitorType;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSeason(): ?int
|
|
{
|
|
return $this->season;
|
|
}
|
|
|
|
public function setSeason(?int $season): static
|
|
{
|
|
$this->season = $season;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEpisode(): ?int
|
|
{
|
|
return $this->episode;
|
|
}
|
|
|
|
public function setEpisode(?int $episode): static
|
|
{
|
|
$this->episode = $episode;
|
|
|
|
return $this;
|
|
}
|
|
}
|