Scalr\Model\Entity\Server::getImage PHP Method

getImage() public method

Get Image entity
public getImage ( ) : Image | null
return Image | null Return Image entity or null
    public function getImage()
    {
        if (!empty($this->imageId) && empty($this->_image)) {
            $this->_image = Image::findOne([['platform' => $this->platform], ['cloudLocation' => in_array($this->platform, [SERVER_PLATFORMS::GCE, SERVER_PLATFORMS::AZURE]) ? '' : $this->cloudLocation], ['id' => $this->imageId], ['$or' => [['accountId' => null], ['$and' => [['accountId' => $this->accountId], ['$or' => [['envId' => $this->envId], ['envId' => null]]]]]]]], null, ['envId' => false]);
        }
        return $this->_image;
    }