projects
/
m6w6
/
pq-gateway
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix
[m6w6/pq-gateway]
/
lib
/
pq
/
Gateway
/
Row.php
diff --git
a/lib/pq/Gateway/Row.php
b/lib/pq/Gateway/Row.php
index 5c0efa4ac19a30da22c3bb7627d8ffb4bd58ada5..e408430c736293fa3750ce810f31600500db1169 100644
(file)
--- a/
lib/pq/Gateway/Row.php
+++ b/
lib/pq/Gateway/Row.php
@@
-26,7
+26,7
@@
class Row implements \JsonSerializable
*/
function __construct(Table $table, array $data = null, $prime = false) {
$this->table = $table;
*/
function __construct(Table $table, array $data = null, $prime = false) {
$this->table = $table;
- $this->data = $data;
+ $this->data =
(array)
$data;
if ($prime) {
$this->prime();
if ($prime) {
$this->prime();
@@
-79,6
+79,12
@@
class Row implements \JsonSerializable
return false;
}
return false;
}
+ function refresh() {
+ $this->data = $this->table->find($this->criteria(), null, 1, 0)->current()->data;
+ $this->cell = array();
+ return $this;
+ }
+
/**
* Fill modified cells
* @return \pq\Gateway\Row
/**
* Fill modified cells
* @return \pq\Gateway\Row
@@
-124,7
+130,7
@@
class Row implements \JsonSerializable
*/
function __get($p) {
if (!isset($this->cell[$p])) {
*/
function __get($p) {
if (!isset($this->cell[$p])) {
- $this->cell[$p] = new Cell($this, $p,
$this->data[$p]
);
+ $this->cell[$p] = new Cell($this, $p,
isset($this->data[$p]) ? $this->data[$p] : null
);
}
return $this->cell[$p];
}
}
return $this->cell[$p];
}