<?php


namespace AutoAdmin\Bundle\Content\Context;


use AutoAdmin\Bundle\Content\Entity\Domain;
use AutoAdmin\Bundle\Content\Entity\Locale;
use AutoAdmin\Bundle\Content\Entity\Site;

class SiteContext
{
    protected ?Site $site = null;
    protected ?Locale $locale = null;
    protected ?Domain $domain = null;

    public function getSite(): ?Site
    {
        return $this->site;
    }

    public function setSite(?Site $site): self
    {
        $this->site = $site;

        return $this;
    }

    public function getLocale(): ?Locale
    {
        return $this->locale;
    }

    public function setLocale(?Locale $locale): self
    {
        $this->locale = $locale;

        return $this;
    }

    public function getDomain(): ?Domain
    {
        return $this->domain;
    }

    public function setDomain(?Domain $domain): void
    {
        $this->domain = $domain;
    }

    public function __toString(): string
    {
        $string = '';
        $string .= $this->getSite()->getSlug();
        $string .= '//';
        $string .= $this->getLocale()->getCode();
        $string .= '//';
        $string .= $this->getDomain()->getDomain();

        return $string;
    }
}
