import poc
[m6w6/pq-gateway] / lib / pq / Query / Expr.php
1 <?php
2
3 namespace pq\Query;
4
5 class Expr
6 {
7 /**
8 * @var string
9 */
10 protected $expression;
11
12 /**
13 * @param string $e the expression or a format string followed by arguments
14 * @param string ...
15 */
16 function __construct($e) {
17 if (func_num_args() > 1) {
18 $this->expression = call_user_func_array("sprintf", func_get_args());
19 } else {
20 $this->expression = $e;
21 }
22 }
23
24 /**
25 * Get the string expression
26 * @return string
27 */
28 function __toString() {
29 return (string) $this->expression;
30 }
31 }