public function url($lang = null)
    {
        if ($this->url === null) {
            if (!$this->id()) {
                return null;
            }

            $this->url = $this->generateUri();
        }

        if ($lang && $this->url instanceof Translation) {
            return $this->url[$lang];
        }

        return strval($this->url);
    }