1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 05:55:02 +03:00

add new methods

This commit is contained in:
Mzhelskiy Maxim 2010-08-11 11:36:33 +00:00
parent 2f69c1b582
commit b60ef91654

View file

@ -516,6 +516,42 @@ class Engine extends Object {
$oEntity=new $sClass($aParams);
return $oEntity;
}
public static function GetPluginName($oModule) {
if (preg_match('/Plugin([^_]+)/',is_string($oModule) ? $oModule : get_class($oModule),$aMatches)) {
if(isset($aMatches[1])) {
return $aMatches[1];
}
}
return null;
}
public static function GetPluginPrefix($oModule) {
if($sPluginName = self::GetPluginName($oModule)) {
return 'Plugin'.$sPluginName.'_';
}
return '';
}
public static function GetModuleName($oModule) {
if (preg_match('/Module([^_]+)/',is_string($oModule) ? $oModule : get_class($oModule),$aMatches)) {
if(isset($aMatches[1])) {
return $aMatches[1];
}
}
return null;
}
public static function GetEntityName($oEntity) {
if (preg_match('/Entity([^_]+)/',is_string($oModule) ? $oModule : get_class($oModule),$aMatches)) {
if(isset($aMatches[1])) {
return $aMatches[1];
}
}
return null;
}
}
/**