Scalr::isAllowedAnalyticsOnHostedScalrAccount PHP Method

isAllowedAnalyticsOnHostedScalrAccount() public static method

Checks whether specified account is allowed to manage Cost centers and Projects on hosted scalr account
public static isAllowedAnalyticsOnHostedScalrAccount ( integer $accountId ) : boolean
$accountId integer Identifier of the client's account
return boolean Returns true if it is allowed of false otherwise
    public static function isAllowedAnalyticsOnHostedScalrAccount($accountId)
    {
        if (!self::isHostedScalr()) {
            return true;
        }
        $accounts = self::config('scalr.hosted.analytics.managed_accounts');
        return !empty($accounts) && is_array($accounts) && in_array($accountId, $accounts) ? true : false;
    }

Usage Example

Example #1
0
 /**
  * Checks whether either it is beta version of interface or not hosted scalr install
  *
  * @return boolean Returns true if it is either a beta version of interface or it isn't hosted scalr install
  */
 public function isInterfaceBetaOrNotHostedScalr()
 {
     return $this->getHeaderVar('Interface-Beta') || Scalr::isAllowedAnalyticsOnHostedScalrAccount($this->getEnvironment()->clientId);
 }
All Usage Examples Of Scalr::isAllowedAnalyticsOnHostedScalrAccount