10 * @var \pq\Gateway\Row
25 * @param \pq\Gateway\Row $row
29 function __construct(Row
$row, $name, $data) {
39 function __toString() {
40 return (string) $this->data
;
44 * Test whether the value is an unevaluated expression
48 return $this->data
instanceof Expr
;
60 * Modify the value in this cell
62 * @param string $op a specific operator
63 * @return \pq\Gateway\Cell
65 function mod($data, $op = null) {
66 if (!($this->data
instanceof Expr
)) {
67 $this->data
= new Expr($this->name
);
69 if (!isset($this->data)) {
70 $this->data = new Expr($this->name);
71 } elseif (is_numeric($this->data)) {
72 $this->data = new Expr($this->data);
74 $this->data = new Expr("%s", $this->row->getTable()->getConnection()->quote($this->data));
79 if ($data instanceof Expr
) {
80 $this->data
->add($data);
81 } elseif (!isset($op) && is_numeric($data)) {
82 $this->data
->add(new Expr("+ $data"));
84 $data = $this->row
->getTable()->getConnection()->quote($data);
85 $this->data
->add(new Expr("%s %s"), isset($op) ?
$op : "||", $data);
91 * Set the value in this cell
93 * @return \pq\Gateway\Cell