Piwik\Site::getTypeFor PHP Method

getTypeFor() public static method

Returns the type of the site with the specified ID.
public static getTypeFor ( $idsite ) : string
$idsite
return string
    public static function getTypeFor($idsite)
    {
        return self::getFor($idsite, 'type');
    }

Usage Example

Example #1
0
 /**
  * Constructor.
  * @param int $idSite If creating settings for a new site that is not created yet, use idSite = 0
  * @param string|null $idMeasurableType If null, idType will be detected from idSite
  * @throws Exception
  */
 public function __construct($idSite, $idMeasurableType = null)
 {
     parent::__construct();
     $this->idSite = (int) $idSite;
     if (!empty($idMeasurableType)) {
         $this->idMeasurableType = $idMeasurableType;
     } elseif (!empty($idSite)) {
         $this->idMeasurableType = Site::getTypeFor($idSite);
     } else {
         throw new Exception('No idType specified for ' . get_class($this));
     }
     $this->init();
 }
All Usage Examples Of Piwik\Site::getTypeFor