You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
739 B
44 lines
739 B
7 years ago
|
<?php
|
||
|
|
||
|
namespace yii\db\conditions;
|
||
|
|
||
|
/**
|
||
|
* Condition based on column-value pairs.
|
||
|
*
|
||
|
* @author Dmytro Naumenko <d.naumenko.a@gmail.com>
|
||
|
* @since 2.0.14
|
||
|
*/
|
||
|
class HashCondition implements ConditionInterface
|
||
|
{
|
||
|
/**
|
||
|
* @var array|null the condition specification.
|
||
|
*/
|
||
|
private $hash;
|
||
|
|
||
|
/**
|
||
|
* HashCondition constructor.
|
||
|
*
|
||
|
* @param array|null $hash
|
||
|
*/
|
||
|
public function __construct($hash)
|
||
|
{
|
||
|
$this->hash = $hash;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return array|null
|
||
|
*/
|
||
|
public function getHash()
|
||
|
{
|
||
|
return $this->hash;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public static function fromArrayDefinition($operator, $operands)
|
||
|
{
|
||
|
return new static($operands);
|
||
|
}
|
||
|
}
|