X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fpq-gateway;a=blobdiff_plain;f=lib%2Fpq%2FGateway%2FCell.php;h=ab2a46fceac95a3a97056fe78bdc4679c20ca2da;hp=3c69a1294d015111db7629aee7234cb5e550dc45;hb=002783858d3a859b1bbae977cc6db4ed13ca0187;hpb=409fca54acfee2db6c62540a8f67b1adfa695a38 diff --git a/lib/pq/Gateway/Cell.php b/lib/pq/Gateway/Cell.php index 3c69a12..ab2a46f 100644 --- a/lib/pq/Gateway/Cell.php +++ b/lib/pq/Gateway/Cell.php @@ -11,11 +11,6 @@ class Cell extends Expressible implements \ArrayAccess */ protected $row; - /** - * @var string - */ - protected $name; - /** * @var bool */ @@ -28,9 +23,8 @@ class Cell extends Expressible implements \ArrayAccess * @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; } @@ -68,6 +62,9 @@ class Cell extends Expressible implements \ArrayAccess * @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;