Class yii\db\conditions\InCondition
| Inheritance | yii\db\conditions\InCondition |
|---|---|
| Implements | yii\db\conditions\ConditionInterface |
| Available since version | 2.0.14 |
| Source Code | https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/InCondition.php |
Class InCondition represents IN condition.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | SimpleCondition constructor | yii\db\conditions\InCondition |
| fromArrayDefinition() | Creates object by array-definition as described in Query Builder – Operator format guide article. | yii\db\conditions\InCondition |
| getColumn() | yii\db\conditions\InCondition | |
| getOperator() | yii\db\conditions\InCondition | |
| getValues() | yii\db\conditions\InCondition |
Method Details
SimpleCondition constructor
| public mixed __construct ( string|string[] $column, string $operator, array $values ) | ||
| $column | string|string[] | The column name. If it is an array, a composite |
| $operator | string | The operator to use (e.g. |
| $values | array | An array of values that column value should be among. If it is an empty array the generated expression will be a |
public function __construct($column, $operator, $values) { $this->column = $column; $this->operator = $operator; $this->values = $values; } Creates object by array-definition as described in Query Builder – Operator format guide article.
| public static static fromArrayDefinition ( mixed $operator, mixed $operands ) | ||
| $operator | mixed | Operator in uppercase. |
| $operands | mixed | Array of corresponding operands |
| throws | yii\base\InvalidArgumentException | if wrong number of operands have been given. |
|---|---|---|
public static function fromArrayDefinition($operator, $operands) { if (!isset($operands[0], $operands[1])) { throw new InvalidArgumentException("Operator '$operator' requires two operands."); } return new static($operands[0], $operator, $operands[1]); }
| public yii\db\ExpressionInterface[]|string[]|integer[] getValues ( ) |
public function getValues() { return $this->values; }
Signup or Login in order to comment.