X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_notify.php;h=e8f140a284351b3594b5acf8a0114227c3f8b09d;hb=73d58457ae7a7a0f139484eda190aec60ab7e561;hp=b75f47a531a2124490ec484301d8c620baf04bd9;hpb=adaf207cf7aebf8f85f16951471785a9d1f7b130;p=Pman.Core diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index b75f47a5..e8f140a2 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -50,26 +50,28 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject function person($set = false) { + $def_pt = 'core_person'; + if ($set !== false) { $this->person_table = is_object($set) ? $set->tableName() : ''; - $def_pt = DB_DataObject::Factory('core_person')->tableName(); - $person_table = empty($this->person_table) ? $def_pt : $this->person_table; + + $person_table = empty($this->person_table) ? $def_pt : strtolower($this->person_table); $col = $person_table == $def_pt ? 'person_id' : $person_table . '_id'; $this->{$col} = is_object($set) ? $set->id : $set; return; } static $cache =array(); - $person_table = empty($this->person_table) ? $def_pt : $this->person_table; + $person_table = empty($this->person_table) ? $def_pt : strtolower($this->person_table); $col = $person_table == $def_pt ? '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 = DB_DataObject::Factory($person_table == 'person' ? 'core_person' : $person_table); $c->get($this->{$col}); $cache[$person_table .':'. $this->{$col}] = $c; return $c;