<?php


namespace AutoAdmin\Bundle\Content\Entity;


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

/**
 * Class ContentReference
 *
 * @package AutoAdmin\Bundle\Entity\Content
 */
#[ORM\Entity]
class ContentReference implements CreatedAtInterface, UpdatedAtInterface
{
    use IdTrait;
    use CreatedAtTrait;
    use UpdatedAtTrait;

    protected bool $pendingDelete = false;

    #[ORM\Column(name: 'referenced_slug', type: Types::STRING, length: 255)]
    protected string $referencedSlug;

    #[ORM\Column(name: 'referenced_action', type: Types::STRING, length: 255)]
    protected string $referencedAction = 'view';

    #[ORM\Column(name: 'referenced_identifier', type: Types::INTEGER, nullable: true)]
    protected ?int $referencedIdentifier = null;

    #[ORM\Column(name: 'referenced_locale', type: Types::INTEGER, nullable: true)]
    protected ?int $referencedLocale = null;

    public function isPendingDelete(): bool
    {
        return $this->pendingDelete;
    }

    public function setPendingDelete(bool $pendingDelete): self
    {
        $this->pendingDelete = $pendingDelete;

        return $this;
    }

    public function getReferencedSlug(): string
    {
        return $this->referencedSlug;
    }

    public function setReferencedSlug(string $referencedSlug): self
    {
        $this->referencedSlug = $referencedSlug;

        return $this;
    }

    public function getReferencedAction(): string
    {
        return $this->referencedAction;
    }

    public function setReferencedAction(string $referencedAction): self
    {
        $this->referencedAction = $referencedAction;

        return $this;
    }

    public function getReferencedIdentifier(): ?int
    {
        return $this->referencedIdentifier;
    }

    public function setReferencedIdentifier(?int $referencedIdentifier): self
    {
        $this->referencedIdentifier = $referencedIdentifier;

        return $this;
    }

    public function getReferencedLocale(): ?int
    {
        return $this->referencedLocale;
    }

    public function setReferencedLocale(?int $referencedLocale): self
    {
        $this->referencedLocale = $referencedLocale;

        return $this;
    }
}
