예제 #1
0
 /**
  * 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);
 }
예제 #2
0
파일: String.php 프로젝트: rmsy/opentrackr
 /**
  * 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);
 }
예제 #3
0
	/**
	 * 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);
	}
예제 #4
0
	/**
	 * Sets the value of this attribute
	 *
	 * @param string $value
	 */
	public function setValue($value)
	{
        parent::setValue(new \MongoRegex((string)$value));
	}
예제 #5
0
	/**
	 * Sets the value of this attribute
	 *
	 * @param boolean $Value
	 */
	public function setValue($value){
	    $cleanValue = (boolean)$value;
        parent::setValue($cleanValue);
	}
예제 #6
0
 /**
  * Overrides parent setValue to add enum value checking
  */
 public function setValue($value)
 {
     if($this->isValidChoice($value)){
         parent::setValue($value);
     }
 }