Example #1
0
 /**
  * @param CHelpdeskUser $oHelpdeskUser
  * @param CHelpdeskThread $oHelpdeskThread
  *
  * @return bool
  */
 public function SetThreadSeen(CHelpdeskUser $oHelpdeskUser, $oHelpdeskThread)
 {
     $this->oConnection->Execute($this->oCommandCreator->ClearThreadSeen($oHelpdeskUser, $oHelpdeskThread));
     $bResult = $this->oConnection->Execute($this->oCommandCreator->SetThreadSeen($oHelpdeskUser, $oHelpdeskThread));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #2
0
 /**
  * @param string $sHash
  *
  * @return array|bool
  */
 public function deleteMinByHash($sHash)
 {
     $mResult = false;
     if (is_string($sHash) && 0 < strlen($sHash)) {
         $mResult = $this->oConnection->Execute($this->oCommandCreator->deleteMinByHash($sHash));
     }
     $this->throwDbExceptionIfExist();
     return $mResult;
 }
Example #3
0
 /**
  * @return bool
  */
 public function createTables()
 {
     $bResult = 1;
     $aTables = $this->getSqlSchemaAsArray();
     foreach ($aTables as $sTableCreateSql) {
         $bResult &= $this->oConnection->Execute($sTableCreateSql);
     }
     $this->throwDbExceptionIfExist();
     return (bool) $bResult;
 }
Example #4
0
 /**
  * @param CAccount $oAccount
  * @param array $aOrder
  *
  * @return bool
  */
 public function FoldersOrderUpdate($oAccount, $aOrder)
 {
     if (!is_array($aOrder)) {
         return false;
     }
     $this->FoldersOrderClear($oAccount);
     $this->oConnection->Execute($this->oCommandCreator->FoldersOrderUpdate($oAccount, @json_encode($aOrder)));
     $this->throwDbExceptionIfExist();
     return true;
 }
Example #5
0
 /**
  * @param string $sSearchDesc Default value is empty string.
  * @param int $iTenantId Default value is **0**.
  *
  * @return int|false
  */
 public function getDomainCount($sSearchDesc = '', $iTenantId = 0)
 {
     $iResultCount = false;
     if ($this->oConnection->Execute($this->oCommandCreator->getDomainCount($sSearchDesc, $iTenantId))) {
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow) {
             $iResultCount = (int) $oRow->domains_count;
         }
         $this->oConnection->FreeResult();
     }
     $this->throwDbExceptionIfExist();
     return $iResultCount;
 }
Example #6
0
 /**
  * @param CSocial &$oSocial
  *
  * @return bool
  */
 public function isSocialExists(CSocial $oSocial)
 {
     $bResult = false;
     if ($this->oConnection->Execute($this->oCommandCreator->isSocialExists($oSocial->IdAccount, $oSocial->TypeStr))) {
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow) {
             $bResult = 0 < (int) $oRow->social_count;
         }
         $this->oConnection->FreeResult();
     }
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #7
0
 /**
  * @param string $sType
  * @param string $sIdSocial
  * @return string
  */
 public function SocialExists($sType, $sIdSocial)
 {
     $bResult = false;
     if ($this->oConnection->Execute($this->oCommandCreator->SocialExists($sType, $sIdSocial))) {
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow) {
             $bResult = 0 < (int) $oRow->social_count;
         }
         $this->oConnection->FreeResult();
     }
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #8
0
 /**
  * @param int $iSubscriptionID
  *
  * @return array|bool
  */
 public function getSubscriptionById($iSubscriptionID)
 {
     $mResult = false;
     if ($this->oConnection->Execute($this->oCommandCreator->getSubscriptionById($iSubscriptionID))) {
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow && isset($oRow->id_tenant) && 0 < (int) $oRow->id_tenant) {
             $oSubscription = new CSubscription((int) $oRow->id_tenant);
             $oSubscription->InitByDbRow($oRow);
             $mResult = $oSubscription;
         }
         $this->oConnection->FreeResult();
     }
     $this->throwDbExceptionIfExist();
     return $mResult;
 }
Example #9
0
 /**
  * Purges all entries in safelist of particular user.
  * 
  * @param string $iUserId User identifier.
  * 
  * @return bool
  */
 public function clearSafetySenders($iUserId)
 {
     $bResult = $this->oConnection->Execute($this->oCommandCreator->clearSafetySendersQuery($iUserId));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #10
0
 /**
  * @param string $sCalendarId
  * @param string $sEventId
  * @return bool
  */
 public function removeEventFromAllGroups($sCalendarId, $sEventId)
 {
     $iResult = $this->oConnection->Execute($this->oCommandCreator->removeEventFromAllGroups($sCalendarId, $sEventId));
     return (bool) $iResult;
 }
Example #11
0
 /**
  * @param CTenantSocials $oSocial
  *
  * @return bool
  */
 public function UpdateSocial(CTenantSocials $oSocial)
 {
     $bResult = $this->oConnection->Execute($this->oCommandCreator->UpdateSocial($oSocial));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #12
0
 /**
  * @param CAccount $oAccount
  * @param int $iFetcherID
  *
  * @return bool
  */
 public function deleteFetcher($oAccount, $iFetcherID)
 {
     $bResult = (bool) $this->oConnection->Execute($this->oCommandCreator->deleteFetcher($oAccount, $iFetcherID));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Example #13
0
 public function testConnection()
 {
     return $this->oConnection->Connect();
 }
Example #14
0
 /**
  * @param int $iTenantId
  *
  * @return bool
  */
 public function UpdateTenantMainCapa($iTenantId, $sCapa)
 {
     $bResult = $this->oConnection->Execute($this->oCommandCreator->UpdateTenantMainCapa($iTenantId, $sCapa));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }