mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-03 06:55:03 +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) {
|
public function __call($sName,$aArgs) {
|
||||||
$sType=strtolower(substr($sName,0,3));
|
$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)));
|
$sKey=strtolower(preg_replace('/([^A-Z])([A-Z])/',"$1_$2",substr($sName,3)));
|
||||||
if ($sType=='get') {
|
if ($sType=='get') {
|
||||||
if (isset($this->_aData[$sKey])) {
|
if (isset($this->_aData[$sKey])) {
|
||||||
return $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;
|
return null;
|
||||||
} elseif ($sType=='set' and key_exists(0,$aArgs)) {
|
} elseif ($sType=='set' and key_exists(0,$aArgs)) {
|
||||||
|
|
Loading…
Reference in a new issue