Scalr\Model\Entity\CloudCredentials::__get PHP Method

__get() public method

Gets the values of the properties that require initialization.
public __get ( string $name ) : mixed
$name string Property name
return mixed Requested property
    public function __get($name)
    {
        switch ($name) {
            case 'properties':
                if (empty($this->_properties)) {
                    $this->_properties = new SettingsCollection('Scalr\\Model\\Entity\\CloudCredentialsProperty', [['cloudCredentialsId' => &$this->id]], ['cloudCredentialsId' => &$this->id]);
                }
                return $this->_properties;
            case 'environments':
                if (!$this->envsLoaded) {
                    $this->_envBinds = [];
                    /* @var $envCloudCreds EnvironmentCloudCredentials */
                    foreach (EnvironmentCloudCredentials::findByCloudCredentialsId($this->id) as $envCloudCreds) {
                        $this->_envBinds[$envCloudCreds->envId] = $envCloudCreds;
                    }
                    $this->envsLoaded = true;
                }
                return $this->_envBinds;
            default:
                return parent::__get($name);
        }
    }