0 follower

Final Class Yiisoft\Db\Pgsql\Builder\StructuredValueBuilder

InheritanceYiisoft\Db\Pgsql\Builder\StructuredValueBuilder » Yiisoft\Db\Expression\Value\Builder\AbstractStructuredValueBuilder

Builds expressions for {@see StructuredValue} for PostgreSQL Server.

Method Details

Hide inherited methods

buildStringValue() protected method

protected string buildStringValue ( string $value, \Yiisoft\Db\Expression\Value\StructuredValue $expression, array &$params )
$value string
$expression \Yiisoft\Db\Expression\Value\StructuredValue
$params array

                protected function buildStringValue(string $value, StructuredValue $expression, array &$params): string
{
    $param = new Param($value, DataType::STRING);
    return $this->queryBuilder->bindParam($param, $params) . $this->getTypeHint($expression);
}

            
buildSubquery() protected method

protected string buildSubquery ( \Yiisoft\Db\Query\QueryInterface $query, \Yiisoft\Db\Expression\Value\StructuredValue $expression, array &$params )
$query \Yiisoft\Db\Query\QueryInterface
$expression \Yiisoft\Db\Expression\Value\StructuredValue
$params array

                protected function buildSubquery(QueryInterface $query, StructuredValue $expression, array &$params): string
{
    [$sql, $params] = $this->queryBuilder->build($query, $params);
    return "($sql)" . $this->getTypeHint($expression);
}

            
buildValue() protected method

protected string buildValue ( array|object $value, \Yiisoft\Db\Expression\Value\StructuredValue $expression, array &$params )
$value array|object
$expression \Yiisoft\Db\Expression\Value\StructuredValue
$params array

                protected function buildValue(array|object $value, StructuredValue $expression, array &$params): string
{
    $value = $this->prepareValues($value, $expression);
    /** @psalm-var string[] $placeholders */
    $placeholders = $this->buildPlaceholders($value, $expression, $params);
    return 'ROW(' . implode(',', $placeholders) . ')' . $this->getTypeHint($expression);
}

            
getLazyArrayValue() protected method

protected array|string getLazyArrayValue ( \Yiisoft\Db\Schema\Data\LazyArrayInterface $value )
$value \Yiisoft\Db\Schema\Data\LazyArrayInterface

                protected function getLazyArrayValue(LazyArrayInterface $value): array|string
{
    if ($value instanceof StructuredLazyArray) {
        return $value->getRawValue();
    }
    return $value->getValue();
}