Added support for the default domain

This commit is contained in:
RainLoop Team 2014-01-24 18:12:11 +04:00
parent 1ca90a8d7a
commit 6ca3b44d05
3 changed files with 11 additions and 8 deletions

View file

@ -35,12 +35,14 @@ class Domain extends \RainLoop\Providers\AbstractProvider
/**
* @param string $sName
* @param bool $bDefaultOnNull = false
*
* @return \RainLoop\Domain | null
*/
public function Load($sName)
public function Load($sName, $bDefaultOnNull = false)
{
return $this->oDriver->Load($sName);
$oDomain = $this->oDriver->Load($sName);
return $oDomain ? $oDomain : ($bDefaultOnNull ? $this->oDriver->Load('default') : null);
}
/**