Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 11
0
 /**
  * @param CTenantSocials $oSocial
  *
  * @return bool
  */
 public function UpdateSocial(CTenantSocials $oSocial)
 {
     $bResult = $this->oConnection->Execute($this->oCommandCreator->UpdateSocial($oSocial));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 13
0
 public function testConnection()
 {
     return $this->oConnection->Connect();
 }
Ejemplo n.º 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;
 }