Class yii\db\conditions\HashCondition

Inheritanceyii\db\conditions\HashCondition
Implementsyii\db\conditions\ConditionInterface
Available since version2.0.14
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/conditions/HashCondition.php

Condition based on column-value pairs.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() HashCondition constructor. yii\db\conditions\HashCondition
fromArrayDefinition() Creates object by array-definition as described in Query Builder – Operator format guide article. yii\db\conditions\HashCondition
getHash() yii\db\conditions\HashCondition

Method Details

Hide inherited methods

__construct() public method

HashCondition constructor.

public void __construct ( $hash )
$hash array|null

                public function __construct($hash)
{
    $this->hash = $hash;
}

            
fromArrayDefinition() public static method

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);
}

            
getHash() public method

public array|null getHash ( )

                public function getHash()
{
    return $this->hash;
}