/** * 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(); }
/** * Constructor. */ public function __construct() { parent::__construct(); $this->init(); }