<?php

namespace AutoAdmin\Bundle\Admin\Entity;

use AutoAdmin\Bundle\Content\Entity\Traits\CreatedAtTrait;
use AutoAdmin\Bundle\Content\Entity\Traits\IdTrait;
use AutoAdmin\Bundle\Content\Model\CreatedAtInterface;
use AutoAdmin\Bundle\Content\Model\IdInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
 * Class CookieConsent
 * @package AutoAdmin\Bundle\Content\Entity
 */
#[ORM\Entity(repositoryClass: 'AutoAdmin\Bundle\Admin\Repository\CookieConsentRepository')]
class CookieConsent implements CreatedAtInterface, IdInterface
{
    use IdTrait;
    use CreatedAtTrait;

    public const COOKIE_CONSENT_EMPTY = null;
    public const COOKIE_CONSENT_TRUE = true;
    public const COOKIE_CONSENT_FALSE = false;

    #[ORM\Column(type: Types::STRING, length: 32)]
    private ?string $hash;

    #[ORM\Column(type: Types::BOOLEAN, nullable: true)]
    private ?bool $type = null;

    public function getHash(): ?string
    {
        return $this->hash;
    }

    public function setHash(string $hash): self
    {
        $this->hash = $hash;

        return $this;
    }

    public function getType(): ?bool
    {
        return $this->type;
    }

    public function setType(?bool $type): self
    {
        $this->type = $type;

        return $this;
    }
}
