public function setValue($value){

        $returnValue = false;

        if(!is_null($value)){
            try{
                $value = new static::$type($value);
                if(!is_null($value)){
                    $this->value = $value;
                    $returnValue = true;
                }
            }catch(DatatypeException $de){
                $type = '('.gettype($value).')';
                if($type == 'object'){
                    $type .= '('.get_class($value).')';
                }
                throw new AttributeException('Cannot assign the value to attribute: '.static::$name.' -> '.$type.' '.$value);
            }
        }

        return $returnValue;
    }
public function setValue($value){

        $returnValue = false;

        if(!is_null($value)){
            try{
                $value = new static::$type($value);
                if(!is_null($value)){
                    $this->value = $value;
                    $returnValue = true;
                }
            }catch(DatatypeException $de){
                $type = '('.gettype($value).')';
                if($type == 'object'){
                    $type .= '('.get_class($value).')';
                }
                throw new AttributeException('Cannot assign the value to attribute: '.static::$name.' -> '.$type.' '.$value);
            }
        }

        return $returnValue;
    }
public function setValue ( $ value ) { $ returnValue = false ; if ( ! is_null ( $ value ) ) { try { $ value = new static :: $ type ( $ value ) ; if ( ! is_null ( $ value ) ) { $ this -> value = $ value ; $ returnValue = true ; } } catch ( DatatypeException $ de ) { $ type = '(' . gettype ( $ value ) . ')' ; if ( $ type == 'object' ) { $ type .= '(' . get_class ( $ value ) . ')' ; } throw new AttributeException ( 'Cannot assign the value to attribute: ' . static :: $ name . ' -> ' . $ type . ' ' . $ value ) ; } } return $ returnValue ; }
Set the attribute value

@param mixed $value
@return boolean
@throws \oat\taoQtiItem\model\qti\attribute\AttributeException
Set the attribute value