Piwik\Site::get PHP Method

get() protected method

Returns a site property by name.
protected get ( string $name ) : mixed
$name string Name of the property to return (eg, `'main_url'` or `'name'`).
return mixed
    protected function get($name)
    {
        if (!isset(self::$infoSites[$this->id])) {
            $site = API::getInstance()->getSiteFromId($this->id);
            if (empty($site)) {
                throw new UnexpectedWebsiteFoundException('The requested website id = ' . (int) $this->id . ' couldn\'t be found');
            }
            self::setSiteFromArray($this->id, $site);
        }
        if (!isset(self::$infoSites[$this->id][$name])) {
            throw new Exception("The property {$name} could not be found on the website ID " . (int) $this->id);
        }
        return self::$infoSites[$this->id][$name];
    }