X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_notify.php;h=a445ded42b7a9d79c37aedfe4ab8303b515a894f;hb=5059b4f75f6a221e9c7480b4e53176d6c189638f;hp=e5c17ee7e2136ca136a60a5115479d016c9ff655;hpb=1844e00dcb0c9067d20c613cbdebafdaf9d10dbc;p=Pman.Core diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index e5c17ee7..a445ded4 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -50,18 +50,22 @@ 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() : ''; - $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}];