DBRole::getEnvironmentObject PHP Method

getEnvironmentObject() public method

public getEnvironmentObject ( ) : Scalr_Environment
return Scalr_Environment Enter description here ...
    public function getEnvironmentObject()
    {
        if (!$this->environment) {
            $this->environment = Scalr_Model::init(Scalr_Model::ENVIRONMENT)->loadById($this->envId);
        }
        return $this->environment;
    }

Usage Example

示例#1
0
 public function RemoveServerSnapshot(DBRole $DBRole)
 {
     foreach ($DBRole->getImageId(SERVER_PLATFORMS::OPENSTACK) as $location => $imageId) {
         $osClient = $this->getOsClient($DBRole->getEnvironmentObject(), $location);
         try {
             $osClient->imageDelete($imageId);
         } catch (Exception $e) {
             if (stristr($e->getMessage(), "Cannot destroy a destroyed snapshot")) {
                 return true;
             } else {
                 throw $e;
             }
         }
     }
     return true;
 }
All Usage Examples Of DBRole::getEnvironmentObject