HashCondition.php 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @link https://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license https://www.yiiframework.com/license/
  6. */
  7. namespace yii\db\conditions;
  8. /**
  9. * Condition based on column-value pairs.
  10. *
  11. * @author Dmytro Naumenko <d.naumenko.a@gmail.com>
  12. * @since 2.0.14
  13. * @phpcs:disable Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore
  14. */
  15. class HashCondition implements ConditionInterface
  16. {
  17. /**
  18. * @var array|null the condition specification.
  19. */
  20. private $hash;
  21. /**
  22. * HashCondition constructor.
  23. *
  24. * @param array|null $hash
  25. */
  26. public function __construct($hash)
  27. {
  28. $this->hash = $hash;
  29. }
  30. /**
  31. * @return array|null
  32. */
  33. public function getHash()
  34. {
  35. return $this->hash;
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public static function fromArrayDefinition($operator, $operands)
  41. {
  42. return new static($operands);
  43. }
  44. }