*/
protected $row;
- /**
- * @var string
- */
- protected $name;
-
/**
* @var bool
*/
* @param bool $dirty
*/
function __construct(Row $row, $name, $data, $dirty = false) {
- parent::__construct($data);
+ parent::__construct($name, $data);
$this->row = $row;
- $this->name = $name;
$this->dirty = $dirty;
}
* @return \pq\Gateway\Cell
*/
function mod($data, $op = null) {
+ if (is_string($data)) {
+ $data = $this->row->getTable()->getConnection()->quote($data);
+ }
parent::mod($data, $op);
$this->dirty = true;
return $this;
class Expressible implements ExpressibleInterface
{
+ /**
+ * @var string
+ */
+ protected $name;
+
/**
* @var mixed
*/
protected $data;
- function __construct($data) {
+ /**
+ * @param string $name
+ * @param mixed $data
+ */
+ function __construct($name, $data) {
+ $this->name = $name;
$this->data = $data;
}
} elseif (!isset($op) && is_numeric($data)) {
$this->data->add(new Expr("+ $data"));
} else {
- if (!is_array($data)) {
- $data = $this->row->getTable()->getConnection()->quote($data);
- }
$this->data->add(new Expr("%s %s", isset($op) ? $op : "||", $data));
}