public function __construct($envId, $platform, $group = null)
{
$this->envId = $envId;
$this->platform = $platform;
$this->group = $group ?: '';
$this->cloud = null;
$this->firstErrorOccurredProp = $platform . '.' . static::NAME_FIRST_ERROR_OCCURRED;
$this->lastErrorMessageProp = $platform . '.' . static::NAME_LAST_ERROR_MESSAGE;
$this->suspendedProp = $platform . '.' . static::NAME_SUSPENDED;
$properties = EnvironmentProperty::find([['envId' => $this->envId], ['group' => $this->group], ['$or' => [["name" => $this->firstErrorOccurredProp], ["name" => $this->lastErrorMessageProp], ["name" => $this->suspendedProp]]]]);
foreach ($properties as $property) {
if ($property->name == $this->firstErrorOccurredProp) {
$this->firstErrorOccurred = $property;
} elseif ($property->name == $this->lastErrorMessageProp) {
$this->lastErrorMessage = $property;
} else {
$this->suspended = $property;
}
}
}