<?php

namespace AutoAdmin\Bundle\Seo\Sitemap\Model;

use DateTimeInterface;

class SitemapUrl
{
    const DEFAULT_CHANGE_FREQ = 'daily';

    protected string $url;
    protected ?DateTimeInterface $lastModification = null;
    protected ?string $changeFrequency = null;
    protected ?float $priority = null;
    /** @var array<string> $images */
    protected array $images = [];

    public function __construct(
        string $url,
        ?DateTimeInterface $lastModification = null,
        ?string $changeFrequency = null,
        ?float $priority = null
    )
    {
        $this->url = $url;
        $this->lastModification = $lastModification;
        $this->changeFrequency = $changeFrequency;
        $this->priority = $priority;
    }

    public function getUrl(): string
    {
        return $this->url;
    }

    public function setUrl(string $url): void
    {
        $this->url = $url;
    }

    public function getLastModification(): ?DateTimeInterface
    {
        return $this->lastModification;
    }

    public function setLastModification(?DateTimeInterface $lastModification): void
    {
        $this->lastModification = $lastModification;
    }

    public function getChangeFrequency(): ?string
    {
        return $this->changeFrequency;
    }

    public function setChangeFrequency(?string $changeFrequency): void
    {
        $this->changeFrequency = $changeFrequency;
    }

    public function getPriority(): ?float
    {
        return $this->priority;
    }

    public function setPriority(?float $priority): void
    {
        $this->priority = $priority;
    }

    public function getImages(): array
    {
        return $this->images;
    }

    public function setImages(array $images): void
    {
        $this->images = $images;
    }

    public function addImages(string $image): void
    {
        $this->images[] = $image;
    }
}
