Abstract Class Yiisoft\Db\QueryBuilder\Condition\AbstractOverlaps
The base class for classes representing the array and JSON overlaps conditions.
Public Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\QueryBuilder\Condition\AbstractOverlaps | |
| fromArrayDefinition() | Creates a condition based on the given operator and operands. | Yiisoft\Db\QueryBuilder\Condition\AbstractOverlaps |
Property Details
Method Details
| public mixed __construct ( Yiisoft\Db\Expression\ExpressionInterface|string $column, Yiisoft\Db\Expression\ExpressionInterface|iterable $values ) | ||
| $column | Yiisoft\Db\Expression\ExpressionInterface|string |
The column name or an expression. |
| $values | Yiisoft\Db\Expression\ExpressionInterface|iterable |
An array of values that {@see $columns} value should overlap. |
public function __construct(
public readonly string|ExpressionInterface $column,
public readonly iterable|ExpressionInterface $values,
) {}
Creates a condition based on the given operator and operands.
| public static Yiisoft\Db\QueryBuilder\Condition\AbstractOverlaps fromArrayDefinition ( string $operator, array $operands ) | ||
| $operator | string | |
| $operands | array | |
| throws | InvalidArgumentException |
If the number of operands isn't 2. |
|---|---|---|
public static function fromArrayDefinition(string $operator, array $operands): static
{
if (!isset($operands[0], $operands[1])) {
throw new InvalidArgumentException("Operator \"$operator\" requires two operands.");
}
/** @psalm-suppress UnsafeInstantiation */
return new static(
self::validateColumn($operator, $operands[0]),
self::validateValues($operator, $operands[1]),
);
}
Signup or Login in order to comment.