/** * Sets the value of this attribute * * @param integer $Value */ public function setValue($value){ $cleanValue = (string)$value; if(!empty($this->maximumLength) && (strlen($cleanValue) > $this->maximumLength) ){ //throw validation exception $cleanValue = substr($cleanValue, 0, $this->maximumLength); } parent::setValue($cleanValue); }
/** * Sets the value of this attribute * * @param mixed $value * @return void */ public function setValue($value) { if (null === $value) { return parent::setValue(null); } $cleanValue = (string) $value; if (!empty($this->maximumLength) && $this->_getUnicodeValue('strlen', $cleanValue) > $this->maximumLength) { $cleanValue = $this->_getUnicodeValue('substr', array($cleanValue, 0, $this->maximumLength)); } parent::setValue($cleanValue); }
/** * Sets the value of this attribute * * @param integer $Value */ public function setValue($value){ $cleanValue = (int)$value; if(!empty($this->minimum) && ($cleanValue < $this->minimum) ){ //throw validation exception $cleanValue = $this->minimum; } if(!empty($this->maximum) && ($cleanValue > $this->maximum) ){ //throw validation exception $cleanValue = $this->maximum; } parent::setValue($cleanValue); }
/** * Sets the value of this attribute * * @param string $value */ public function setValue($value) { parent::setValue(new \MongoRegex((string)$value)); }
/** * Sets the value of this attribute * * @param boolean $Value */ public function setValue($value){ $cleanValue = (boolean)$value; parent::setValue($cleanValue); }
/** * Overrides parent setValue to add enum value checking */ public function setValue($value) { if($this->isValidChoice($value)){ parent::setValue($value); } }