HashCondition.php 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://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. */
  14. class HashCondition implements ConditionInterface
  15. {
  16. /**
  17. * @var array|null the condition specification.
  18. */
  19. private $hash;
  20. /**
  21. * HashCondition constructor.
  22. *
  23. * @param array|null $hash
  24. */
  25. public function __construct($hash)
  26. {
  27. $this->hash = $hash;
  28. }
  29. /**
  30. * @return array|null
  31. */
  32. public function getHash()
  33. {
  34. return $this->hash;
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public static function fromArrayDefinition($operator, $operands)
  40. {
  41. return new static($operands);
  42. }
  43. }