当前位置: 首页>>代码示例>>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;未经允许,请勿转载。