Scalr\Model\Entity\RoleImage::isUsed PHP Метод

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

Check whether the Role is used in any farm
public isUsed ( ) : boolean
Результат boolean Returns true if the Role is used in some farm or false otherwise
    public function isUsed()
    {
        if (in_array($this->platform, [SERVER_PLATFORMS::GCE, SERVER_PLATFORMS::AZURE])) {
            return !!$this->db()->GetOne("SELECT EXISTS(SELECT 1 FROM farm_roles WHERE role_id = ? AND platform = ?)", [$this->roleId, $this->platform]);
        } else {
            return !!$this->db()->GetOne("SELECT EXISTS(SELECT 1 FROM farm_roles WHERE role_id = ? AND platform = ? AND cloud_location = ?)", [$this->roleId, $this->platform, $this->cloudLocation]);
        }
    }