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.

42 lines
772B

  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\debug\components\search\matchers;
  8. use yii\base\Component;
  9. /**
  10. * Base class for matchers that are used in a filter.
  11. *
  12. * @author Mark Jebri <mark.github@yandex.ru>
  13. * @since 2.0
  14. */
  15. abstract class Base extends Component implements MatcherInterface
  16. {
  17. /**
  18. * @var mixed base value to check
  19. */
  20. protected $baseValue;
  21. /**
  22. * @inheritdoc
  23. */
  24. public function setValue($value)
  25. {
  26. $this->baseValue = $value;
  27. }
  28. /**
  29. * @inheritdoc
  30. */
  31. public function hasValue()
  32. {
  33. return !empty($this->baseValue) || ($this->baseValue === '0');
  34. }
  35. }