0

Final Class yii\db\oci\LobValueBuilder

Inheritanceyii\db\oci\LobValueBuilder
Implementsyii\db\ExpressionBuilderInterface
Available since version22.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/oci/LobValueBuilder.php

Builds the SQL value expression for an {@see LobValue}.

Registers the payload under a fresh locator placeholder and renders EMPTY_BLOB().

Public Methods

Hide inherited methods

Method Description Defined By
bind() Registers the payload under a fresh locator placeholder. yii\db\oci\LobValueBuilder
build() Method builds the raw SQL from the $expression that will not be additionally escaped or quoted. yii\db\oci\LobValueBuilder

Constants

Hide inherited constants

Constant Value Description Defined By
PARAM_PREFIX ':lob' yii\db\oci\LobValueBuilder

Method Details

Hide inherited methods

bind() public static method

Registers the payload under a fresh locator placeholder.

Returns the placeholder explicitly so callers building a RETURNING clause never infer it from $params.

public static array{0: string, 1: string} bind ( yii\db\oci\LobValue $expression, array &$params )
$expression yii\db\oci\LobValue

LOB value to register.

$params array

The parameters to be bound to the SQL statement. This parameter is passed by reference and will be modified by this method.

return array{0: string, 1: string}

SQL value expression and locator placeholder.

                public static function bind(LobValue $expression, array &$params): array
{
    $placeholder = self::PARAM_PREFIX . count($params);
    while (array_key_exists($placeholder, $params)) {
        $placeholder .= '_';
    }
    $params[$placeholder] = $expression;
    return ['EMPTY_BLOB()', $placeholder];
}

            
build() public method

Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.

public string build ( yii\db\oci\LobValue $expression, array &$params = [] )
$expression yii\db\oci\LobValue

LOB value to build.

$params array

The binding parameters.

return string

The raw SQL that will not be additionally escaped or quoted.

                public function build(ExpressionInterface $expression, array &$params = [])
{
    [$sql] = self::bind($expression, $params);
    return $sql;
}