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