protected function composeColumnValue($indexes, $columnName, $value, &$params)
    {
        if ($value === null) {
            return 'NULL';
        } elseif ($value instanceof Expression) {
            $params = array_merge($params, $value->params);
            return $value->expression;
        }
        foreach ($indexes as $index) {
            $columnSchema = $index->getColumn($columnName);
            if ($columnSchema !== null) {
                break;
            }
        }
        if (is_array($value)) {
            // MVA :
            $lineParts = [];
            foreach ($value as $subValue) {
                if ($subValue instanceof Expression) {
                    $params = array_merge($params, $subValue->params);
                    $lineParts[] = $subValue->expression;
                } else {
                    $phName = self::PARAM_PREFIX . count($params);
                    $lineParts[] = $phName;
                    $params[$phName] = (isset($columnSchema)) ? $columnSchema->dbTypecast($subValue) : $subValue;
                }
            }

            return '(' . implode(',', $lineParts) . ')';
        } else {
            $phName = self::PARAM_PREFIX . count($params);
            $params[$phName] = (isset($columnSchema)) ? $columnSchema->dbTypecast($value) : $value;
            return $phName;
        }
    }
protected function composeColumnValue($indexes, $columnName, $value, &$params)
    {
        if ($value === null) {
            return 'NULL';
        } elseif ($value instanceof Expression) {
            $params = array_merge($params, $value->params);
            return $value->expression;
        }
        foreach ($indexes as $index) {
            $columnSchema = $index->getColumn($columnName);
            if ($columnSchema !== null) {
                break;
            }
        }
        if (is_array($value)) {
            // MVA :
            $lineParts = [];
            foreach ($value as $subValue) {
                if ($subValue instanceof Expression) {
                    $params = array_merge($params, $subValue->params);
                    $lineParts[] = $subValue->expression;
                } else {
                    $phName = self::PARAM_PREFIX . count($params);
                    $lineParts[] = $phName;
                    $params[$phName] = (isset($columnSchema)) ? $columnSchema->dbTypecast($subValue) : $subValue;
                }
            }

            return '(' . implode(',', $lineParts) . ')';
        } else {
            $phName = self::PARAM_PREFIX . count($params);
            $params[$phName] = (isset($columnSchema)) ? $columnSchema->dbTypecast($value) : $value;
            return $phName;
        }
    }
protected function composeColumnValue ( $ indexes , $ columnName , $ value , & $ params ) { if ( $ value === null ) { return 'NULL' ; } elseif ( $ value instanceof Expression ) { $ params = array_merge ( $ params , $ value -> params ) ; return $ value -> expression ; } foreach ( $ indexes as $ index ) { $ columnSchema = $ index -> getColumn ( $ columnName ) ; if ( $ columnSchema !== null ) { break ; } } if ( is_array ( $ value ) ) { // MVA : $ lineParts = [ ] ; foreach ( $ value as $ subValue ) { if ( $ subValue instanceof Expression ) { $ params = array_merge ( $ params , $ subValue -> params ) ; $ lineParts [ ] = $ subValue -> expression ; } else { $ phName = self :: PARAM_PREFIX . count ( $ params ) ; $ lineParts [ ] = $ phName ; $ params [ $ phName ] = ( isset ( $ columnSchema ) ) ? $ columnSchema -> dbTypecast ( $ subValue ) : $ subValue ; } } return '(' . implode ( ',' , $ lineParts ) . ')' ; } else { $ phName = self :: PARAM_PREFIX . count ( $ params ) ; $ params [ $ phName ] = ( isset ( $ columnSchema ) ) ? $ columnSchema -> dbTypecast ( $ value ) : $ value ; return $ phName ; } }
Composes column value for SQL, taking in account the column type.
@param IndexSchema[] $indexes list of indexes, which affected by query
@param string $columnName name of the column
@param mixed $value raw column value
@param array $params the binding parameters to be populated
@return string SQL expression, which represents column value
Composes column value for SQL taking in account the column type .