Пример #1
0
 /**
  * @throws CApiBaseException(Errs::Db_ExceptionError) 3001
  *
  * @return bool
  */
 public function createDatabase()
 {
     CDbCreator::ClearStatic();
     $aConnections =& CDbCreator::CreateConnector($this->oSettings);
     $oConnect = $aConnections[0];
     if ($oConnect) {
         $oConnect->ConnectNoSelect();
         $oConnect->Execute($this->oCommandCreator->createDatabase($this->oSettings->GetConf('DBName')));
     } else {
         throw new CApiBaseException(Errs::Db_ExceptionError);
     }
     return true;
 }
Пример #2
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;
 }
Пример #3
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;
 }
Пример #4
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;
 }
Пример #5
0
 /**
  * @return bool
  */
 public function getAttributesNamesByEntityType($sEntityTypes)
 {
     $bResult = $this->oConnection->Execute($this->oCommandCreator->getAttributesNamesByEntityType($sEntityTypes));
     $this->throwDbExceptionIfExist();
     return $bResult;
 }