Expression.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\db;
  12. class Expression
  13. {
  14. /**
  15. * 查询表达式
  16. *
  17. * @var string
  18. */
  19. protected $value;
  20. /**
  21. * 创建一个查询表达式
  22. *
  23. * @param string $value
  24. * @return void
  25. */
  26. public function __construct($value)
  27. {
  28. $this->value = $value;
  29. }
  30. /**
  31. * 获取表达式
  32. *
  33. * @return string
  34. */
  35. public function getValue()
  36. {
  37. return $this->value;
  38. }
  39. public function __toString()
  40. {
  41. return (string) $this->value;
  42. }
  43. }