<?php


namespace AutoAdmin\Bundle\Seo\Entity;

use AutoAdmin\Bundle\Media\Attributes\LinkedMedia;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;


#[ORM\Embeddable]
class OpenGraphMetadata
{
    # [Assert\NotNull(message: 'Veuillez choisir une image')]
    #[ORM\Column(type: Types::STRING, length: 255, nullable: true)]
    #[LinkedMedia(mappings: ['image'])]
    private ?string $image = null;

// for now, we don't want a dedicated url field, as we can get it from the current page canonical
//    #[ORM\Column(type: Types::STRING, length: 255, nullable: true)]
//    protected ?string $url = '';

    public function getImage(): ?string
    {
        return $this->image;
    }

    public function setImage(?string $image): self
    {
        $this->image = $image;

        return $this;
    }
}
