Gc\Mvc\Listener\DocumentListener::getLocale PHP Method

getLocale() protected method

Get locale according to the locale specified in the document or its parent.
protected getLocale ( Model $document ) : void
$document Gc\Document\Model Document
return void
    protected function getLocale($document)
    {
        $locale = null;
        if (!$document->hasLocale()) {
            $parent = $document->getParent();
            if ($parent) {
                $locale = $this->getLocale($parent);
            }
        } else {
            $locale = $document->getLocale();
        }
        return $locale;
    }