Final Class yii\db\oci\LobValueBuilder
| Inheritance | yii\ |
|---|---|
| Implements | yii\ |
| Available since version | 22.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
| Method | Description | Defined By |
|---|---|---|
| bind() | Registers the payload under a fresh locator placeholder. | yii\ |
| build() | Method builds the raw SQL from the $expression that will not be additionally escaped or quoted. | yii\ |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| PARAM_PREFIX | ':lob' | yii\ |
Method Details
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\ | ||
| $expression | yii\ |
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];
}
Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.
| public string build ( yii\ | ||
| $expression | yii\ |
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;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.