當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FOFModel::buildQuery方法代碼示例

本文整理匯總了PHP中FOFModel::buildQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP FOFModel::buildQuery方法的具體用法?PHP FOFModel::buildQuery怎麽用?PHP FOFModel::buildQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FOFModel的用法示例。


在下文中一共展示了FOFModel::buildQuery方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildQuery

 /**
  * Builds the SELECT query
  *
  * @param   boolean  $overrideLimits  Are we requested to override the set limits?
  *
  * @return  JDatabaseQuery
  *
  * @since   3.2
  */
 public function buildQuery($overrideLimits = false)
 {
     $query = parent::buildQuery($overrideLimits);
     $db = $this->getDbo();
     // Add a forced extension filtering to the list
     $eid = $this->getState('eid', 700);
     $query->where($db->qn('extension_id') . ' = ' . $db->q($eid));
     // Force filter only enabled messages
     $published = $this->getState('published', 1, 'int');
     $query->where($db->qn('enabled') . ' = ' . $db->q($published));
     return $query;
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:21,代碼來源:messages.php

示例2: buildQuery

 /**
  * ajust the query
  *
  * @param   boolean  $overrideLimits  Are we requested to override the set limits?
  *
  * @return  JDatabaseQuery
  */
 public function buildQuery($overrideLimits = false)
 {
     // If SEF is enabled then start is a state var and will be used as filter from FOF
     $this->blacklistFilters('start');
     $query = parent::buildQuery($overrideLimits);
     $db = $this->getDbo();
     $task = $this->getState('task');
     $formName = $this->getState('form_name');
     if (FOFPlatform::getInstance()->isBackend()) {
         // Filter on catid
         $catid = (int) $this->input->get('category');
         if ($catid != 0) {
             $query->where($db->qn('catid') . ' = ' . $catid);
         }
         return $query;
     }
     if (FOFPlatform::getInstance()->isFrontend()) {
         $query->where($db->qn('enabled') . ' = 1');
         if (!in_array($formName, array('form.search', 'form.export'))) {
             $now = JFactory::getDate()->format("Y-m-d");
             $query->where('(' . $db->qn('sdate') . ' >= ' . "'{$now}'" . ' OR ' . $db->qn('edate') . ' >= ' . "'{$now}'" . ')');
             return $query;
         }
         // Search or export form
         $isfreeofcharge = $this->input->get('s_isfreeofcharge', 0);
         if ($isfreeofcharge == 1) {
             $query->where($db->qn('isfreeofcharge') . ' = 1');
         }
         $sdate = $this->input->get('s_sdate');
         if ($sdate == '') {
             $sdate = JFactory::getDate()->format("Y-m-d");
         } else {
             $sdate = $this->formatDate($sdate);
         }
         $query->where($db->qn('sdate') . ' >= ' . $db->q($sdate));
         $edate = $this->input->get('s_edate');
         if ($edate != '') {
             $query->where($db->qn('edate') . ' <= ' . $db->q($edate));
         } else {
             $edate = $this->formatDate($edate);
         }
         $pcodefrom = $this->input->get('pcodefrom');
         if ($pcodefrom != '') {
             $query->where($db->qn('pcode') . ' >= ' . $db->q($pcodefrom));
         }
         $pcodeupto = $this->input->get('pcodeupto');
         if ($pcodeupto != '') {
             $query->where($db->qn('pcode') . ' <= ' . $db->q($pcodeupto));
         }
         $fulltext = $this->input->get('fulltext', '', 'string');
         if ($fulltext != '') {
             $fulltext = '%' . $fulltext . '%';
             $query->where('(' . $db->qn('name') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('organiser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('contact') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('ainfo') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('street') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('pcode') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('city') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('state') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('country') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('teaser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('text') . ' like ' . $db->q($fulltext) . ')');
         }
         $excatid = (array) $this->input->get('excatid');
         if (!empty($excatid)) {
             $excatid = array_map('intval', $excatid);
             $excatid = implode(',', $excatid);
             $query->where($db->qn('catid') . ' IN ' . '(' . $excatid . ')');
         }
     }
     return $query;
 }
開發者ID:rdeutz,項目名稱:babioon-event,代碼行數:70,代碼來源:events.php

示例3: buildQuery

 public function buildQuery($overrideLimits = false)
 {
     return parent::buildQuery();
 }
開發者ID:katebmedia,項目名稱:SP-Simple-Portfolio,代碼行數:4,代碼來源:items.php


注:本文中的FOFModel::buildQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。