Beispiel #1
0
 /**
  * @param int $iSubscriptionID
  *
  * @return string
  */
 public function getSubscriptionById($iSubscriptionID)
 {
     $aMap = api_AContainer::DbReadKeys(CSubscription::getStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sawm_subscriptions WHERE %s = %d';
     return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $this->escapeColumn('id_subscription'), $iSubscriptionID);
 }
Beispiel #2
0
 /**
  * @param CAccount $oAccount
  * @return string
  */
 public function getFetchers($oAccount)
 {
     $aMap = api_AContainer::DbReadKeys(CFetcher::getStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sawm_fetchers WHERE %s = %d';
     return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $this->escapeColumn('id_acct'), $oAccount->IdAccount);
 }
Beispiel #3
0
 /**
  * @param string $sWhere
  * @param string $sTableName
  * @param array $aStaticMap
  * @param object $oHelper
  *
  * @return string
  */
 public static function DbGetObjectSqlString($sWhere, $sTableName, $aStaticMap, $oHelper)
 {
     $aMap = api_AContainer::DbReadKeys($aStaticMap);
     $aMap = array_map(array($oHelper, 'EscapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %s WHERE %s';
     return sprintf($sSql, implode(', ', $aMap), $sTableName, $sWhere);
 }
 /**
  * @param string $sWhere
  * @return string
  */
 protected function getSocialByWhere($sWhere)
 {
     $aMap = api_AContainer::DbReadKeys(CSocial::GetStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sawm_social WHERE %s';
     return sprintf($sSql, implode(', ', $aMap), $this->Prefix(), $sWhere);
 }
 /**
  * @param string $sWhere
  * @return string
  */
 protected function getAccountByWhere($sWhere)
 {
     $aMap = api_AContainer::DbReadKeys(CTwofactorauth::getStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %stwofa_accounts WHERE %s';
     return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere);
 }
 /**
  * @param CHelpdeskUser $oHelpdeskUser
  * @param int $iPostId
  *
  * @return string
  */
 public function GetAttachments(CHelpdeskUser $oHelpdeskUser, CHelpdeskThread $oHelpdeskThread)
 {
     $aMap = api_AContainer::DbReadKeys(CHelpdeskAttachment::GetStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sahd_attachments';
     $sSql = sprintf($sSql, implode(', ', $aMap), $this->Prefix());
     $aWhere = array();
     if (0 < $oHelpdeskUser->IdTenant) {
         $aWhere[] = $this->escapeColumn('id_tenant') . ' = ' . $oHelpdeskUser->IdTenant;
     }
     $aWhere[] = $this->escapeColumn('id_helpdesk_thread') . ' = ' . $oHelpdeskThread->IdHelpdeskThread;
     return $sSql . ' WHERE ' . implode(' AND ', $aWhere);
 }
 /**
  * @param string $sWhere
  * @return string
  */
 protected function getGroupByWhere($sWhere)
 {
     $aMap = api_AContainer::DbReadKeys(CGroup::getStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sawm_addr_groups WHERE %s';
     return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere);
 }
Beispiel #8
0
 /**
  * Returns query-string for obtaining user by specified condition.
  * 
  * @param string $sWhere Specified condition.
  * 
  * @return string
  */
 protected function _getUserByWhereQuery($sWhere)
 {
     $aMap = api_AContainer::DbReadKeys(CUser::getStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sSql = 'SELECT %s FROM %sawm_settings WHERE %s';
     return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere);
 }