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


PHP xPDOQuery類代碼示例

本文整理匯總了PHP中xPDOQuery的典型用法代碼示例。如果您正苦於以下問題:PHP xPDOQuery類的具體用法?PHP xPDOQuery怎麽用?PHP xPDOQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     if ($active = $this->getProperty('active')) {
         $c->where(array('active' => 1));
     }
     return $c;
 }
開發者ID:bendasvadim,項目名稱:miniPayment,代碼行數:7,代碼來源:getlist.class.php

示例2: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $c->select(array('qsbSetUserGroup.*', 'UserGroup.name'));
     $c->innerJoin('modUserGroup', 'UserGroup');
     $c->where(array('set' => $this->getProperty('id')));
     return $c;
 }
開發者ID:Realetive,項目名稱:QuickstartButtons,代碼行數:7,代碼來源:getlist.class.php

示例3: prepareQueryBeforeCount

 /**
  * Can be used to adjust the query prior to the COUNT statement
  *
  * @param xPDOQuery $c
  *
  * @return xPDOQuery
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     if ($query = $this->getProperty('query', null)) {
         $c->where(array('ip:LIKE' => '%' . $query . '%'));
     }
     return $c;
 }
開發者ID:jolichter,項目名稱:modxTalks,代碼行數:14,代碼來源:getlist.class.php

示例4: prepareQueryBeforeCount

 /**
  * @param xPDOQuery $c
  *
  * @return xPDOQuery
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $c->rightJoin('modResourceGroup', 'modResourceGroup', 'modResourceGroup.id = msdProductGroup.id');
     $c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
     $c->select($this->modx->getSelectColumns('modResourceGroup', 'modResourceGroup'));
     return $c;
 }
開發者ID:Homchenkokostya,項目名稱:msDiscount,代碼行數:12,代碼來源:getlist.class.php

示例5: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $query = $this->getProperty('searchbox');
     $combo = $this->getProperty('combobox');
     $history = $this->getProperty('historical');
     //$qu = array();
     if (!empty($query)) {
         $qu = array('title:LIKE' => '%' . preg_replace('/[^a-rtzA-Z0-9]/', '%', $query) . '%');
     }
     $andState = !empty($query) ? 'AND:' : '';
     if (!empty($combo)) {
         $calfilt = $this->modx->newQuery('GcCalendarCalsConnect');
         $calfilt->where(array('calid:=' => $combo));
         $cals = $this->modx->getCollection('GcCalendarCalsConnect', $calfilt);
         $cids = array();
         foreach ($cals as $ca) {
             $cids[] = $ca->get('evid');
         }
         $tp = array($andState . 'id:IN' => $cids);
     }
     $andState = !empty($query) || !empty($combo) ? 'AND:' : '';
     $stime = strtotime('-1 day');
     $tim = $history == 1 ? array($andState . 'start:<=' => $stime, 'AND:end:<=' => $stime, 'or:repeatenddate:<=' => $stime) : array($andState . 'start:>=' => $stime, 'OR:end:>=' => $stime, 'OR:repeatenddate:>=' => $stime);
     $c->where(array($qu, $tp, $tim));
     return $c;
 }
開發者ID:blue148,項目名稱:GCCalendar2,代碼行數:26,代碼來源:getlist.class.php

示例6: prepareQueryBeforeCount

 /**
  * @param xPDOQuery $c
  *
  * @return xPDOQuery
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     if ($tid = $this->getProperty('tid')) {
         $c->where(array('tid' => $tid));
     }
     return parent::prepareQueryBeforeCount($c);
 }
開發者ID:sfgoo,項目名稱:xPoller2,代碼行數:12,代碼來源:getlist.class.php

示例7: getResults

 protected function getResults(xPDOQuery &$c)
 {
     $list = array();
     $this->currentIndex = 0;
     if ($c->prepare()) {
         if ($c->stmt->execute()) {
             while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {
                 $object_id = $row['object_id'];
                 if (empty($list[$object_id])) {
                     $list[$object_id] = $row;
                     $list[$object_id]['tvs'] = array();
                     $this->currentIndex++;
                 }
                 if (!empty($row['tv_name'])) {
                     $list[$object_id]['tvs'][$row['tv_name']] = array('tv_id' => $row['tv_id'], 'caption' => $row['tv_caption'], 'category' => $row['tv_category'], 'value_id' => $row['tv_value_id'], 'value' => $row['tv_value']);
                 }
             }
         } else {
             if ($c->stmt->errorCode() !== "00000") {
                 $this->modx->log(xPDO::LOG_LEVEL_ERROR, __CLASS__);
                 $this->modx->log(xPDO::LOG_LEVEL_ERROR, print_r($c->stmt->errorInfo(), true));
                 $this->modx->log(xPDO::LOG_LEVEL_ERROR, $c->toSQL());
             }
         }
     }
     return $list;
 }
開發者ID:Tramp1357,項目名稱:atlasorg,代碼行數:27,代碼來源:getdata.class.php

示例8: prepareQueryBeforeCount

 function prepareQueryBeforeCount(xPDOQuery $c)
 {
     // Filter by position
     if ($position = $this->getProperty('position')) {
         $mode = $this->getProperty('mode', 'include');
         $q = $this->modx->newQuery('byAdPosition');
         $q->select('ad');
         $q->where(array('position' => $position));
         if ($q->prepare() && $q->stmt->execute()) {
             $ads = array_unique($q->stmt->fetchAll(PDO::FETCH_COLUMN));
         }
         if (!empty($ads)) {
             if ($mode == 'exclude') {
                 $c->where(array('id:NOT IN' => $ads));
             } else {
                 $c->where(array('id:IN' => $ads));
             }
         }
     }
     // Filter by search query
     if ($query = $this->getProperty('query')) {
         $c->where(array('name:LIKE' => "%{$query}%", 'OR:description:LIKE' => "%{$query}%"));
     }
     return $c;
 }
開發者ID:suasti,項目名稱:BannerY,代碼行數:25,代碼來源:getlist.class.php

示例9: prepareQueryBeforeCount

 /**
  * {@inheritdoc}
  * @param xPDOQuery $c
  * @return xPDOQuery
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $this->elementId = $this->getProperty('elementId', false);
     $this->elementType = $this->getProperty('elementType', false);
     $id = $this->getProperty('id', 0);
     /*$tagNameParts = xPDO :: escSplit('@', $this->getProperty('tag'));
       $propertySet = isset($tagNameParts[1]) ? trim($tagNameParts[1]) : null;
       if (isset($propertySet) && strpos($propertySet,':') != false) {
           $propSetParts = xPDO :: escSplit(':', $propertySet);
           $propertySet = trim($propSetParts[0]);
       }*/
     $c->leftJoin('modElementPropertySet', 'Elements', array('Elements.element_class' => $this->elementType, 'Elements.element' => $this->elementId, 'Elements.property_set = modPropertySet.id'));
     $this->showNotAssociated = (bool) $this->getProperty('showNotAssociated', false);
     $showAssociated = (bool) $this->getProperty('showAssociated', false);
     if ($this->showNotAssociated) {
         $c->where(array('Elements.property_set' => null));
     } else {
         if ($showAssociated) {
             $c->where(array('Elements.property_set:!=' => null));
         }
     }
     /*if (empty($id)) {
           $propertySet = $this->getProperty('propertySet', '');
           if (!empty($propertySet) && $this->modx->getCount('modPropertySet', array('name'=>$propertySet))) {
               $c->orCondition("modPropertySet.name = {$this->modx->quote($propertySet)}");
           }
       }*/
     return $c;
 }
開發者ID:sergant210,項目名稱:tagElementPlugin,代碼行數:34,代碼來源:getpropertysetlist.class.php

示例10: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $lang_key = $this->getProperty('langid');
     $contextlm = $this->getProperty('contextlm');
     $c->where(array('lang_key' => $lang_key, 'context' => $contextlm));
     return $c;
 }
開發者ID:bendasvadim,項目名稱:MODX.Xlexicon,代碼行數:7,代碼來源:getlist.class.php

示例11: prepareQueryBeforeCount

 /**
  * @param xPDOQuery $c
  *
  * @return xPDOQuery
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $c->innerJoin('sxNewsletter', 'sxNewsletter', 'sxNewsletter.id = sxQueue.newsletter_id');
     $c->select($this->modx->getSelectColumns('sxQueue', 'sxQueue'));
     $c->select('sxNewsletter.name as newsletter');
     return $c;
 }
開發者ID:ksneo,項目名稱:Sendex,代碼行數:12,代碼來源:getlist.class.php

示例12: prepareQueryBeforeCount

 /** {@inheritDoc} */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     if ($query = $this->getProperty('query')) {
         $c->where(array('word:LIKE' => "%{$query}%", 'OR:alias:LIKE' => "%{$query}%"));
     }
     return $c;
 }
開發者ID:svyatoslavteterin,項目名稱:belton.by,代碼行數:8,代碼來源:getlist.class.php

示例13: prepareQueryAfterCount

 public function prepareQueryAfterCount(xPDOQuery $c)
 {
     if ($this->getProperty('sort') == 'category') {
         $c->sortby('parent', $this->getProperty('dir', 'ASC'));
     }
     return $c;
 }
開發者ID:raadhuis,項目名稱:modx-basic,代碼行數:7,代碼來源:getlist.class.php

示例14: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $search = $this->getProperty('search', '');
     if (!empty($search)) {
         $c->where(array('name:LIKE' => '%' . $search . '%', 'OR:path:LIKE' => '%' . $search . '%'));
     }
     return $c;
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:8,代碼來源:getlist.class.php

示例15: prepareQueryBeforeCount

 /**
  * @return mixed
  */
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $tid = $this->getProperty('tid');
     if ($tid) {
         $c->where(array('template' => $tid));
     }
     return $c;
 }
開發者ID:sergant210,項目名稱:AdminTools,代碼行數:11,代碼來源:getlist.class.php


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