/** * @param CTenant $oTenant * * @return bool */ public function TenantExists(CTenant $oTenant) { $bResult = false; $niExceptTenantId = 0 < $oTenant->IdTenant ? $oTenant->IdTenant : null; if ($this->oConnection->Execute($this->oCommandCreator->TenantExists($oTenant->Login, $niExceptTenantId))) { $oRow = $this->oConnection->GetNextRecord(); if ($oRow && 0 < (int) $oRow->tenants_count) { $bResult = true; } $this->oConnection->FreeResult(); } $this->throwDbExceptionIfExist(); return $bResult; }