1: <?php
2: /**
3: * @category Horde
4: * @package Rdo
5: */
6:
7: /**
8: * Horde_Rdo literal query string object.
9: *
10: * If you need to pass a string that should not be quoted into a
11: * Horde_Rdo_Query object, wrap it in a Horde_Rdo_Query_Literal object
12: * and it will not be quoted or escaped. Note that of course you need
13: * to be very careful about introducing user input or any other
14: * untrusted input into these objects.
15: *
16: * Example:
17: * $literal = new Horde_Rdo_Query_Literal('MAX(column_name)');
18: *
19: * @category Horde
20: * @package Rdo
21: */
22: class Horde_Rdo_Query_Literal
23: {
24: /**
25: * SQL literal string.
26: *
27: * @var string
28: */
29: protected $_string;
30:
31: /**
32: * Instantiate a literal, which is just a string stored as
33: * an instance member variable.
34: *
35: * @param string $string The string containing an SQL literal.
36: */
37: public function __construct($string)
38: {
39: $this->_string = (string)$string;
40: }
41:
42: /**
43: * @return string The SQL literal stored in this object.
44: */
45: public function __toString()
46: {
47: return $this->_string;
48: }
49: }
50: