src/ORM/Connect/MySQLiConnector.php
public function parsePreparedParameters($parameters, &$blobs)
    {
        $types = '';
        $values = array();
        $blobs = array();
        $parametersCount = count($parameters);
        for ($index = 0; $index < $parametersCount; $index++) {
            $value = $parameters[$index];
            $phpType = gettype($value);

            // Allow overriding of parameter type using an associative array
            if ($phpType === 'array') {
                $phpType = $value['type'];
                $value = $value['value'];
            }

            // Convert php variable type to one that makes mysqli_stmt_bind_param happy
            // @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php
            switch ($phpType) {
                case 'boolean':
                case 'integer':
                    $types .= 'i';
                    break;
                case 'float': // Not actually returnable from gettype
                case 'double':
                    $types .= 'd';
                    break;
                case 'object': // Allowed if the object or resource has a __toString method
                case 'resource':
                case 'string':
                case 'NULL': // Take care that a where clause should use "where XX is null" not "where XX = null"
                    $types .= 's';
                    break;
                case 'blob':
                    $types .= 'b';
                    // Blobs must be sent via send_long_data and set to null here
                    $blobs[] = array(
                        'index' => $index,
                        'value' => $value
                    );
                    $value = null;
                    break;
                case 'array':
                case 'unknown type':
                default:
                    user_error(
                        "Cannot bind parameter \"$value\" as it is an unsupported type ($phpType)",
                        E_USER_ERROR
                    );
                    break;
            }
            $values[] = $value;
        }
        return array_merge(array($types), $values);
    }
public function parsePreparedParameters($parameters, &$blobs)
    {
        $types = '';
        $values = array();
        $blobs = array();
        $parametersCount = count($parameters);
        for ($index = 0; $index < $parametersCount; $index++) {
            $value = $parameters[$index];
            $phpType = gettype($value);

            // Allow overriding of parameter type using an associative array
            if ($phpType === 'array') {
                $phpType = $value['type'];
                $value = $value['value'];
            }

            // Convert php variable type to one that makes mysqli_stmt_bind_param happy
            // @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php
            switch ($phpType) {
                case 'boolean':
                case 'integer':
                    $types .= 'i';
                    break;
                case 'float': // Not actually returnable from gettype
                case 'double':
                    $types .= 'd';
                    break;
                case 'object': // Allowed if the object or resource has a __toString method
                case 'resource':
                case 'string':
                case 'NULL': // Take care that a where clause should use "where XX is null" not "where XX = null"
                    $types .= 's';
                    break;
                case 'blob':
                    $types .= 'b';
                    // Blobs must be sent via send_long_data and set to null here
                    $blobs[] = array(
                        'index' => $index,
                        'value' => $value
                    );
                    $value = null;
                    break;
                case 'array':
                case 'unknown type':
                default:
                    user_error(
                        "Cannot bind parameter \"$value\" as it is an unsupported type ($phpType)",
                        E_USER_ERROR
                    );
                    break;
            }
            $values[] = $value;
        }
        return array_merge(array($types), $values);
    }
public function parsePreparedParameters ( $ parameters , & $ blobs ) { $ types = '' ; $ values = array ( ) ; $ blobs = array ( ) ; $ parametersCount = count ( $ parameters ) ; for ( $ index = 0 ; $ index < $ parametersCount ; $ index ++ ) { $ value = $ parameters [ $ index ] ; $ phpType = gettype ( $ value ) ; // Allow overriding of parameter type using an associative array if ( $ phpType === 'array' ) { $ phpType = $ value [ 'type' ] ; $ value = $ value [ 'value' ] ; } // Convert php variable type to one that makes mysqli_stmt_bind_param happy // @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php switch ( $ phpType ) { case 'boolean' : case 'integer' : $ types .= 'i' ; break ; case 'float' : // Not actually returnable from gettype case 'double' : $ types .= 'd' ; break ; case 'object' : // Allowed if the object or resource has a __toString method case 'resource' : case 'string' : case 'NULL' : // Take care that a where clause should use "where XX is null" not "where XX = null" $ types .= 's' ; break ; case 'blob' : $ types .= 'b' ; // Blobs must be sent via send_long_data and set to null here $ blobs [ ] = array ( 'index' => $ index , 'value' => $ value ) ; $ value = null ; break ; case 'array' : case 'unknown type' : default : user_error ( "Cannot bind parameter \"$value\" as it is an unsupported type ($phpType)" , E_USER_ERROR ) ; break ; } $ values [ ] = $ value ; } return array_merge ( array ( $ types ) , $ values ) ; }
Prepares the list of parameters in preparation for passing to mysqli_stmt_bind_param

@param array $parameters List of parameters
@param array &$blobs Out parameter for list of blobs to bind separately
@return array List of parameters appropriate for mysqli_stmt_bind_param function
Prepares the list of parameters in preparation for passing to mysqli_stmt_bind_param