123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- namespace yii\db\conditions;
- use yii\base\InvalidArgumentException;
- use yii\db\ExpressionInterface;
- class InCondition implements ConditionInterface
- {
-
- private $operator;
-
- private $column;
-
- private $values;
-
- public function __construct($column, $operator, $values)
- {
- $this->column = $column;
- $this->operator = $operator;
- $this->values = $values;
- }
-
- public function getOperator()
- {
- return $this->operator;
- }
-
- public function getColumn()
- {
- return $this->column;
- }
-
- public function getValues()
- {
- return $this->values;
- }
-
- 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]);
- }
- }
|