Scalr\Model\Entity\Image::isUsedGlobal PHP Метод

isUsedGlobal() публичный Метод

If image is used in any environment (servers, farmRoles) or had duplicates in another environments
public isUsedGlobal ( ) : boolean
Результат boolean
    public function isUsedGlobal()
    {
        $status = !!$this->db()->GetOne('SELECT EXISTS(SELECT 1 FROM role_images WHERE image_id = ? AND platform = ? AND cloud_location = ?)', [$this->id, $this->platform, $this->cloudLocation]);
        if ($this->platform == \SERVER_PLATFORMS::GCE) {
            $status = $status || !!$this->db()->GetOne('SELECT EXISTS(SELECT 1 FROM servers WHERE image_id = ? AND platform = ? AND env_id = ?)', [$this->id, $this->platform, $this->envId]);
        } else {
            $status = $status || !!$this->db()->GetOne('SELECT EXISTS(SELECT 1 FROM servers WHERE image_id = ? AND platform = ? AND cloud_location = ? AND env_id = ?)', [$this->id, $this->platform, $this->cloudLocation, $this->envId]);
        }
        $status = $status || Image::find([['id' => $this->id], ['platform' => $this->platform], ['cloudLocation' => $this->cloudLocation]])->count() > 1;
        return $status;
    }