/** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set($propertyName, $propertyValue) { switch ($propertyName) { case 'pieChartShadowSize': if (!is_numeric($propertyValue) || $propertyValue < 0) { throw new ezcBaseValueException($propertyName, $propertyValue, 'float >= 0'); } $this->properties['pieChartShadowSize'] = (int) $propertyValue; break; case 'pieChartShadowTransparency': if (!is_numeric($propertyValue) || $propertyValue < 0 || $propertyValue > 1) { throw new ezcBaseValueException($propertyName, $propertyValue, '0 <= float <= 1'); } $this->properties['pieChartShadowTransparency'] = (double) $propertyValue; break; case 'pieChartShadowColor': $this->properties['pieChartShadowColor'] = ezcGraphColor::create($propertyValue); break; default: return parent::__set($propertyName, $propertyValue); } }
/** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set($propertyName, $propertyValue) { switch ($propertyName) { case 'fillAxis': case 'fillGrid': if ($propertyValue !== false && !is_numeric($propertyValue) || $propertyValue < 0 || $propertyValue > 1) { throw new ezcBaseValueException($propertyName, $propertyValue, 'false OR 0 <= float <= 1'); } $this->properties[$propertyName] = $propertyValue === false ? false : (double) $propertyValue; break; case 'depth': case 'pieChartRotation': case 'pieChartShadowTransparency': case 'barDarkenSide': case 'barDarkenTop': case 'barChartGleam': if (!is_numeric($propertyValue) || $propertyValue < 0 || $propertyValue > 1) { throw new ezcBaseValueException($propertyName, $propertyValue, '0 <= float <= 1'); } $this->properties[$propertyName] = (double) $propertyValue; break; case 'pieChartHeight': case 'pieChartShadowSize': if (!is_numeric($propertyValue) || $propertyValue <= 0) { throw new ezcBaseValueException($propertyName, $propertyValue, 'float > 0'); } $this->properties[$propertyName] = (double) $propertyValue; break; case 'seperateLines': if (!is_bool($propertyValue)) { throw new ezcBaseValueException($propertyName, $propertyValue, 'bool'); } $this->properties['seperateLines'] = $propertyValue; break; case 'pieChartShadowColor': $this->properties['pieChartShadowColor'] = ezcGraphColor::create($propertyValue); break; default: return parent::__set($propertyName, $propertyValue); } }