1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 05:55:02 +03:00
This commit is contained in:
Mzhelskiy Maxim 2010-08-03 20:13:44 +00:00
parent 00999c5cfa
commit 86d87c21d9

View file

@ -60,11 +60,18 @@ abstract class Entity extends Object {
*/
public function __call($sName,$aArgs) {
$sType=strtolower(substr($sName,0,3));
if (!strpos($sName,'_') and in_array($sType,array('get','set'))) {
if (!strpos($sName,'_') and in_array($sType,array('get','set'))) {
$sKey=strtolower(preg_replace('/([^A-Z])([A-Z])/',"$1_$2",substr($sName,3)));
if ($sType=='get') {
if (isset($this->_aData[$sKey])) {
if (isset($this->_aData[$sKey])) {
return $this->_aData[$sKey];
} else {
if (preg_match('/Entity([^_]+)/',get_class($this),$sModulePrefix)) {
$sModulePrefix=strtolower($sModulePrefix[1]).'_';
if (isset($this->_aData[$sModulePrefix.$sKey])) {
return $this->_aData[$sModulePrefix.$sKey];
}
}
}
return null;
} elseif ($sType=='set' and key_exists(0,$aArgs)) {