public function url($lang = null)
    {
        $slug = $this->slug();

        if ($slug instanceof Translation && $lang) {
            return $slug[$lang];
        }

        if ($slug) {
            return $slug;
        }

        $url = (string)$this->getLatestObjectRoute($lang)->slug();
        return $url;
    }
public function url($lang = null)
    {
        $slug = $this->slug();

        if ($slug instanceof Translation && $lang) {
            return $slug[$lang];
        }

        if ($slug) {
            return $slug;
        }

        $url = (string)$this->getLatestObjectRoute($lang)->slug();
        return $url;
    }
public function url ( $ lang = null ) { $ slug = $ this -> slug ( ) ; if ( $ slug instanceof Translation && $ lang ) { return $ slug [ $ lang ] ; } if ( $ slug ) { return $ slug ; } $ url = ( string ) $ this -> getLatestObjectRoute ( $ lang ) -> slug ( ) ; return $ url ; }
Retrieve the object's URI.

@param  string|null $lang If object is multilingual, return the object route for the specified locale.
@return string
Retrieve the object s URI .