public function addValue($value)
    {
        if ($this->datatype == 'string') {
            if (is_string($value) == false) {
                throw new InvalidArgumentException('The value(' . $value . ') is not string but the restriction demands it');
            }
        } elseif ($this->datatype == 'integer') {
            // The value comes as string from the wsdl
            if (is_string($value)) {
                $value = intval($value);
            }

            if (is_int($value) == false) {
                throw new InvalidArgumentException('The value(' . $value . ') is not int but the restriction demands it');
            }
        } else {
            if ($value == null) {
                throw new InvalidArgumentException('Value(' . $value . ') is null');
            }
        }

        $this->values[] = $value;
    }
public function addValue($value)
    {
        if ($this->datatype == 'string') {
            if (is_string($value) == false) {
                throw new InvalidArgumentException('The value(' . $value . ') is not string but the restriction demands it');
            }
        } elseif ($this->datatype == 'integer') {
            // The value comes as string from the wsdl
            if (is_string($value)) {
                $value = intval($value);
            }

            if (is_int($value) == false) {
                throw new InvalidArgumentException('The value(' . $value . ') is not int but the restriction demands it');
            }
        } else {
            if ($value == null) {
                throw new InvalidArgumentException('Value(' . $value . ') is null');
            }
        }

        $this->values[] = $value;
    }
public function addValue ( $ value ) { if ( $ this -> datatype == 'string' ) { if ( is_string ( $ value ) == false ) { throw new InvalidArgumentException ( 'The value(' . $ value . ') is not string but the restriction demands it' ) ; } } elseif ( $ this -> datatype == 'integer' ) { // The value comes as string from the wsdl if ( is_string ( $ value ) ) { $ value = intval ( $ value ) ; } if ( is_int ( $ value ) == false ) { throw new InvalidArgumentException ( 'The value(' . $ value . ') is not int but the restriction demands it' ) ; } } else { if ( $ value == null ) { throw new InvalidArgumentException ( 'Value(' . $ value . ') is null' ) ; } } $ this -> values [ ] = $ value ; }
Adds the value, typechecks strings and integers.
Otherwise it only checks so the value is not null

@param mixed $value The value to add
@throws InvalidArgumentException if the value doesn'nt fit in the restriction
Adds the value typechecks strings and integers . Otherwise it only checks so the value is not null