5 class Expressible
implements ExpressibleInterface
12 function __construct($data) {
20 function __toString() {
21 return (string) $this->data
;
25 * Test whether the value is an unevaluated expression
29 return $this->data
instanceof Expr
;
43 * @return \pq\Query\Expressible
53 * @param string $op a specific operator
54 * @return \pq\Query\Expressible
56 function mod($data, $op = null) {
57 if (!($this->data
instanceof Expr
)) {
58 $this->data
= new Expr($this->name
);
61 if ($data instanceof Expr
) {
62 $this->data
->add($data);
63 } elseif (!isset($op) && is_numeric($data)) {
64 $this->data
->add(new Expr("+ $data"));
66 $data = $this->row
->getTable()->getConnection()->quote($data);
67 $this->data
->add(new Expr("%s %s", isset($op) ?
$op : "||", $data));