mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
PHPDoc and code conventions
This commit is contained in:
@@ -93,7 +93,7 @@ abstract class Controller
|
||||
*/
|
||||
public function InitFromModule()
|
||||
{
|
||||
$sModulePath = dirname(dirname($this->getDir()));
|
||||
$sModulePath = dirname(dirname($this->GetDir()));
|
||||
$this->SetModuleName(basename($sModulePath));
|
||||
$this->SetViewPath($sModulePath.'/view');
|
||||
try
|
||||
@@ -128,7 +128,10 @@ abstract class Controller
|
||||
$this->m_sModule = $sModule;
|
||||
}
|
||||
|
||||
private function getDir()
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function GetDir(): string
|
||||
{
|
||||
return dirname((new ReflectionClass(static::class))->getFileName());
|
||||
}
|
||||
|
||||
@@ -424,12 +424,16 @@ JS;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetOrgId(){
|
||||
/**
|
||||
* @return string The current organization ID of the app. context
|
||||
*/
|
||||
public function GetOrgId(): string
|
||||
{
|
||||
$oAppContext = new ApplicationContext();
|
||||
$iCurrentOrganization = $oAppContext->GetCurrentValue('org_id');
|
||||
$sCurrentOrganization = $oAppContext->GetCurrentValue('org_id');
|
||||
|
||||
if(!empty($iCurrentOrganization)) {
|
||||
return $iCurrentOrganization;
|
||||
if(!empty($sCurrentOrganization)) {
|
||||
return $sCurrentOrganization;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user