3 namespace pq\Gateway\Table
;
8 * An optimistic row lock implementation using a versioning column
10 class OptimisticLock
implements LockInterface
13 * The name of the versioning column
19 * @param string $column
21 function __construct($column = "version") {
22 $this->column
= $column;
27 * @param \pq\Gateway\Row $row
28 * @param array $where reference to the criteria
30 function onUpdate(Row
$row, array &$where) {
31 $where["{$this->column}="] = $row->getData()[$this->column
];
32 $row->{$this->column
}->mod(+
1);