return $changes;
}
+ /**
+ * Cell accessor
+ * @param string $p column name
+ * @return \pq\Gateway\Cell
+ */
+ protected function cell($p) {
+ if (!isset($this->cell[$p])) {
+ $this->cell[$p] = new Cell($this, $p, isset($this->data[$p]) ? $this->data[$p] : null);
+ }
+ return $this->cell[$p];
+ }
+
/**
* Get a cell or parent rows
* @param string $p
if ($this->table->hasRelation($p)) {
return $this->table->by($this, $p);
}
- if (!isset($this->cell[$p])) {
- $this->cell[$p] = new Cell($this, $p, isset($this->data[$p]) ? $this->data[$p] : null);
- }
- return $this->cell[$p];
+ return $this->cell($p);
}
/**
* @param mixed $v
*/
function __set($p, $v) {
- $this->__get($p)->set($v);
+ $this->cell($p)->set($v);
}
/**
$this->assertEquals("$key + 123 || 'foobar' - now()", (string) $row->$key);
}
}
+
+ public function testRef() {
+ $rows = $this->table->find(null, "id desc", 2);
+ $reft = new Table("reftest");
+ $refs = new Rowset($reft);
+ $refs->append($rows->seek(0)->current()->reftest()->current());
+ $refs->append($rows->seek(1)->current()->reftest()->current());
+ $refs->seek(0)->current()->test = $rows->seek(1)->current();
+ $refs->seek(1)->current()->test = $rows->seek(0)->current();
+ $refs->update();
+ }
}