X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_notify.php;h=a445ded42b7a9d79c37aedfe4ab8303b515a894f;hb=5059b4f75f6a221e9c7480b4e53176d6c189638f;hp=5c510a18d70730e1dc3158047434b5410aca1106;hpb=b32fbd1b9b89daaa38bf6f9fe84a8fe5f30bd6e5;p=Pman.Core diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index 5c510a18..a445ded4 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -48,23 +48,24 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - - - function person($set = false) { + $def_pt = 'core_person'; + if ($set !== false) { $this->person_table = is_object($set) ? $set->tableName() : ''; - $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) ? $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) ? 'Person' : $this->person_table; - $col = $person_table == "Person" ? 'person_id' : $person_table . '_id'; + $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}];