projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58945fd
)
DataObjects/Core_notify.php
author
Alan Knowles
<alan@roojs.com>
Thu, 11 Jun 2015 04:23:47 +0000
(12:23 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 11 Jun 2015 04:23:47 +0000
(12:23 +0800)
DataObjects/Core_notify.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_notify.php
b/DataObjects/Core_notify.php
index
dfde126
..
e73e61c
100644
(file)
--- a/
DataObjects/Core_notify.php
+++ b/
DataObjects/Core_notify.php
@@
-54,12
+54,17
@@
class Pman_Core_DataObjects_Core_notify extends DB_DataObject
$this->person_id = is_object($set) ? $set->id : $set;
return;
}
$this->person_id = is_object($set) ? $set->id : $set;
return;
}
-
+ static $cache =array();
$person_table = empty($this->person_table) ? 'Person' : $this->person_table;
$col = $person_table == "Person" ? 'person_id' : $person_table . '_id';
$person_table = empty($this->person_table) ? 'Person' : $this->person_table;
$col = $person_table == "Person" ? 'person_id' : $person_table . '_id';
-
+
+ if (isset($cache[$person_table .':'. $this->{$col}])) {
+ return $cache[$person_table .':'. $this->{$col}];
+ }
+
$c = DB_DataObject::Factory($person_table);
$c->get($this->{$col});
$c = DB_DataObject::Factory($person_table);
$c->get($this->{$col});
+ $cache[$person_table .':'. $this->{$col}] = $c;
return $c;
}
return $c;
}