$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';
-
+
+ if (isset($cache[$person_table .':'. $this->{$col}])) {
+ return $cache[$person_table .':'. $this->{$col}];
+ }
+
$c = DB_DataObject::Factory($person_table);
$c->get($this->{$col});
+ $cache[$person_table .':'. $this->{$col}] = $c;
return $c;
}