Lines Matching defs:rid
14 public function __construct($table, $pid, $ts = 0, $rid = 0)
16 parent::__construct($table, $pid, $ts, $rid);
24 if (!$this->rid) return; // no data
27 $sql = 'DELETE FROM data_' . $this->schema->getTable() . ' WHERE rid = ?';
28 $this->sqlite->query($sql, $this->rid);
29 $sql = 'DELETE FROM multi_' . $this->schema->getTable() . ' WHERE rid = ?';
30 $this->sqlite->query($sql, $this->rid);
44 protected function buildGetDataSQL($idColumn = 'rid')
58 $rid = $this->getRid() ?: "(SELECT (COALESCE(MAX(rid), 0 ) + 1) FROM $this->stable)";
60 return "REPLACE INTO $this->stable (rid, $cols)
61 VALUES ($rid," . trim(str_repeat('?,', count($vals)), ',') . ');';
69 return "REPLACE INTO $this->mtable (pid, rid, rev, latest, colref, row, value) VALUES (?,?,?,?,?,?,?)";
108 return [$this->pid, $this->rid, AccessTable::DEFAULT_REV, AccessTable::DEFAULT_LATEST];
112 * Set new rid if this is a new insert
118 if (!$this->rid) {
119 $this->rid = $this->sqlite->queryValue("SELECT rid FROM $this->stable WHERE ROWID = last_insert_rowid()");
120 if (!$this->rid) {
138 * @param int $rid
141 protected function handleEmptyMulti($pid, $rid, $colref)
145 "DELETE FROM $table WHERE pid = ? AND rid = ? AND colref = ?",
146 $pid, $rid, $colref