<?php

namespace App\Entity;

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

#[ORM\Entity(repositoryClass: ViewRepository::class)]
class View extends \App\Entity\AbstractEntity
{
    use NameableTrait;

    #[ORM\Column]
    private ?bool $favourite = null;

    #[ORM\Column(type: Types::JSON, nullable: true)]
    private ?array $filters = [];

    #[ORM\ManyToOne]
    private ?User $user = null;

    public function setName(string $name): static
    {
        $this->name = $name;

        return $this;
    }

    public function isFavourite(): ?bool
    {
        return $this->favourite;
    }

    public function setFavourite(bool $favourite): static
    {
        $this->favourite = $favourite;

        return $this;
    }

    public function getFilters(): ?array
    {
        return $this->filters;
    }

    public function setFilters(?array $filters): static
    {
        $this->filters = $filters;

        return $this;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): static
    {
        $this->user = $user;

        return $this;
    }
}
