Class yii\db\conditions\OrCondition
Inheritance | yii\db\conditions\OrCondition » yii\db\conditions\ConjunctionCondition |
---|---|
Implements | yii\db\conditions\ConditionInterface |
Available since version | 2.0.14 |
Source Code | https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/OrCondition.php |
Condition that connects two or more SQL expressions with the AND
operator.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$expressions | array | yii\db\conditions\ConjunctionCondition |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | yii\db\conditions\ConjunctionCondition | |
fromArrayDefinition() | Creates object by array-definition as described in Query Builder – Operator format guide article. | yii\db\conditions\ConjunctionCondition |
getExpressions() | yii\db\conditions\ConjunctionCondition | |
getOperator() | Returns the operator that is represented by this condition class, e.g. AND , OR . |
yii\db\conditions\OrCondition |
Method Details
public void __construct ( $expressions ) | ||
$expressions | mixed |
public function __construct($expressions) // TODO: use variadic params when PHP>5.6
{
$this->expressions = $expressions;
}
Defined in: yii\db\conditions\ConjunctionCondition::fromArrayDefinition()
Creates object by array-definition as described in Query Builder – Operator format guide article.
public static $this fromArrayDefinition ( $operator, $operands ) | ||
$operator | string |
Operator in uppercase. |
$operands | array |
Array of corresponding operands |
throws | yii\base\InvalidParamException |
if input parameters are not suitable for this condition |
---|
public static function fromArrayDefinition($operator, $operands)
{
return new static($operands);
}
public array getExpressions ( ) |
public function getExpressions()
{
return $this->expressions;
}
Returns the operator that is represented by this condition class, e.g. AND
, OR
.
public string getOperator ( ) |
public function getOperator()
{
return 'OR';
}