X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fpq-gateway;a=blobdiff_plain;f=lib%2Fpq%2FGateway%2FRow.php;fp=lib%2Fpq%2FGateway%2FRow.php;h=78ec4c4e9c2d38e6ef82c118a07c3bf19eb6772f;hp=cda8d4af67a0ba857a6854b4f8c262f016f5e34d;hb=c236ef4b1efd3f5d3a03a390f9a3721b06fa1e72;hpb=cf4c83fd909161f6bfb448dca0f731e76b76a41c diff --git a/lib/pq/Gateway/Row.php b/lib/pq/Gateway/Row.php index cda8d4a..78ec4c4 100644 --- a/lib/pq/Gateway/Row.php +++ b/lib/pq/Gateway/Row.php @@ -253,6 +253,7 @@ class Row implements \JsonSerializable * @return \pq\Gateway\Row */ function create() { + $this->table->notify($this, "create"); $rowset = $this->table->create($this->changes()); if (!count($rowset)) { throw new \UnexpectedValueException("No row created"); @@ -267,11 +268,9 @@ class Row implements \JsonSerializable * @return \pq\Gateway\Row */ function update() { - $criteria = $this->criteria(); - if (($lock = $this->getTable()->getLock())) { - $lock->onUpdate($this, $criteria); - } - $rowset = $this->table->update($criteria, $this->changes()); + $where = $this->criteria(); + $this->table->notify($this, "update", $where); + $rowset = $this->table->update($where, $this->changes()); if (!count($rowset)) { throw new \UnexpectedValueException("No row updated"); } @@ -285,6 +284,7 @@ class Row implements \JsonSerializable * @return \pq\Gateway\Row */ function delete() { + $this->table->notify($this, "delete"); $rowset = $this->table->delete($this->criteria(), "*"); if (!count($rowset)) { throw new \UnexpectedValueException("No row deleted");