Expression.php 658 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace PHPixie\DB;
  3. /**
  4. * This class allows you to wrap fields or values that you don't want to be escaped
  5. * inside the query
  6. * @package Database
  7. */
  8. class Expression
  9. {
  10. /**
  11. * Part of query that should not be escaped
  12. * @var mixed
  13. */
  14. public $value;
  15. /**
  16. * Marks a part of query as a database specific expression,
  17. * e.g. calls to SQL functions like MAX(), SUBSTR() etc.
  18. * Example
  19. * <code>
  20. * $q->fields($this->pixie->db->expr('COUNT(*)'));
  21. * </code>
  22. *
  23. * @param mixed $value Part of query that should not be escaped
  24. * @return Expression_Database
  25. */
  26. public function __construct($value)
  27. {
  28. $this->value = $value;
  29. }
  30. }