10 * @var \pq\Gateway\Row
30 * @param \pq\Gateway\Row $row
35 function __construct(Row
$row, $name, $data, $dirty = false) {
39 $this->dirty
= $dirty;
46 function __toString() {
47 return (string) $this->data
;
51 * Test whether the value is an unevaluated expression
55 return $this->data
instanceof Expr
;
59 * Check whether the cell has been modified
75 * Modify the value in this cell
77 * @param string $op a specific operator
78 * @return \pq\Gateway\Cell
80 function mod($data, $op = null) {
81 if (!($this->data
instanceof Expr
)) {
82 $this->data
= new Expr($this->name
);
85 if ($data instanceof Expr
) {
86 $this->data
->add($data);
87 } elseif (!isset($op) && is_numeric($data)) {
88 $this->data
->add(new Expr("+ $data"));
90 $data = $this->row
->getTable()->getConnection()->quote($data);
91 $this->data
->add(new Expr("%s %s"), isset($op) ?
$op : "||", $data);
100 * Set the value in this cell
102 * @return \pq\Gateway\Cell
104 function set($data) {