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.
 
 
 
 
 
 

49 lines
1.1 KiB

  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. }