PHPDoc and code conventions

This commit is contained in:
Molkobain
2021-01-22 09:24:40 +01:00
parent 2ed785fb06
commit 1bb6d62c17
2 changed files with 13 additions and 6 deletions

View File

@@ -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());
}

View File

@@ -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 '';
}