public function set($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $value) {
                ValueValidator::validate($value);
            }
            $this->_values = $name;
        } else {
            if (is_int($name) || is_string($name)) {
                $this->_values[(string) $name] = $value;
                ValueValidator::validate($value);
            } else {
                throw new ClientException('Bind variable name should be string or int');
            }
        }
    }
public function set($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $value) {
                ValueValidator::validate($value);
            }
            $this->_values = $name;
        } else {
            if (is_int($name) || is_string($name)) {
                $this->_values[(string) $name] = $value;
                ValueValidator::validate($value);
            } else {
                throw new ClientException('Bind variable name should be string or int');
            }
        }
    }
public function set ( $ name , $ value = null ) { if ( is_array ( $ name ) ) { foreach ( $ name as $ value ) { ValueValidator :: validate ( $ value ) ; } $ this -> _values = $ name ; } else { if ( is_int ( $ name ) || is_string ( $ name ) ) { $ this -> _values [ ( string ) $ name ] = $ value ; ValueValidator :: validate ( $ value ) ; } else { throw new ClientException ( 'Bind variable name should be string or int' ) ; } } }
Set the value of a single bind variable or set all bind variables at once

This will also validate the bind values.

Allowed value types for bind parameters are string, int,
double, bool and array. Arrays must not contain any other
than these types.

@throws ClientException

@param string|int|array $name  - name of bind variable OR an array with all bind variables
@param string           $value - value for bind variable

@return void
Set the value of a single bind variable or set all bind variables at once