mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
This commit is contained in:
parent
00999c5cfa
commit
86d87c21d9
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue