当前位置: 首页>>代码示例>>PHP>>正文


PHP Criteria::addDescendingOrderByColumn方法代码示例

本文整理汇总了PHP中Criteria::addDescendingOrderByColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::addDescendingOrderByColumn方法的具体用法?PHP Criteria::addDescendingOrderByColumn怎么用?PHP Criteria::addDescendingOrderByColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Criteria的用法示例。


在下文中一共展示了Criteria::addDescendingOrderByColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUsersRankedByBest

 public static function getUsersRankedByBest()
 {
     $c = new Criteria();
     $c->addDescendingOrderByColumn(UserPeer::WINS);
     $c->addDescendingOrderByColumn(UserPeer::KILLS);
     return self::doSelect($c);
 }
开发者ID:adatta02,项目名称:comp194ma,代码行数:7,代码来源:UserPeer.php

示例2: execute

 public function execute($request)
 {
     if (!$this->context->user->hasCredential(array('contributor', 'editor', 'administrator'), false)) {
         QubitAcl::forwardUnauthorized();
     }
     if (!isset($request->limit)) {
         $request->limit = sfConfig::get('app_hits_per_page');
     }
     $criteria = new Criteria();
     switch ($request->sort) {
         case 'nameDown':
             $criteria->addDescendingOrderByColumn('identifier');
             break;
         case 'nameUp':
             $criteria->addAscendingOrderByColumn('identifier');
             break;
         case 'updatedDown':
             $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         case 'updatedUp':
             $criteria->addAscendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         default:
             if (!$this->getUser()->isAuthenticated()) {
                 $criteria->addAscendingOrderByColumn('authorized_form_of_name');
             } else {
                 $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             }
     }
     // Page results
     $this->pager = new QubitPager('QubitAccession');
     $this->pager->setCriteria($criteria);
     $this->pager->setMaxPerPage($request->limit);
     $this->pager->setPage($request->page);
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:35,代码来源:browseAction.class.php

示例3: executeList

 public function executeList()
 {
     $title = "Most recent bug reports and feature suggestions";
     $tab = str_replace(' ', '', $this->getRequestParameter('tab', 'mostrecent'));
     $c = new Criteria();
     if ($tab == 'mostrecent') {
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
     } elseif ($tab == 'mostpopular') {
         $c2 = new Criteria();
         $c2->add(sfRecommendationPeer::RECOMMENDABLE_MODEL, 'SuggestedFeature');
         $c2->addDescendingOrderByColumn(sfRecommendationPeer::SCORE);
         $recommendations = sfRecommendationPeer::doSelect($c2);
         // this loop has got to be SUPER intensive, it has to change soon
         $features = array();
         foreach ($recommendations as $recommended) {
             $features[] = SuggestedFeaturePeer::retrieveByPK($recommended->getRecommendableId());
         }
         $title = "Most popular bug reports and feature suggestions";
     } elseif ($tab == 'bugs') {
         $c->add(SuggestedFeaturePeer::TYPE, sfConfig::get('app_feature_type_bug'));
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
         $title = 'Bug Reports';
     } elseif ($tab == 'features') {
         $c->add(SuggestedFeaturePeer::TYPE, sfConfig::get('app_feature_type_feature'));
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
         $title = 'Feature Suggestions';
     }
     //This only works while it's not a pager, not a long term solution!
     if (!isset($features)) {
         $this->features = SuggestedFeaturePeer::doSelect($c);
     } else {
         $this->features = $features;
     }
     myToolkit::prependPageTitle($title);
 }
开发者ID:sgrove,项目名称:cothinker,代码行数:35,代码来源:actions.class.php

示例4: execute

 public function execute($request)
 {
     if (!isset($request->limit)) {
         $request->limit = sfConfig::get('app_hits_per_page');
     }
     $criteria = new Criteria();
     switch ($request->sort) {
         case 'nameDown':
             $criteria->addDescendingOrderByColumn('authorized_form_of_name');
             break;
         case 'nameUp':
             $criteria->addAscendingOrderByColumn('authorized_form_of_name');
             break;
         case 'updatedDown':
             $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         case 'updatedUp':
             $criteria->addAscendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         default:
             if (!$this->getUser()->isAuthenticated()) {
                 $criteria->addAscendingOrderByColumn('authorized_form_of_name');
             } else {
                 $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             }
     }
     // Do source culture fallback
     $criteria = QubitCultureFallback::addFallbackCriteria($criteria, 'QubitFunction');
     // Page results
     $this->pager = new QubitPager('QubitFunction');
     $this->pager->setCriteria($criteria);
     $this->pager->setMaxPerPage($request->limit);
     $this->pager->setPage($request->page);
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:34,代码来源:browseAction.class.php

示例5: execute

 public function execute($request)
 {
     if (!isset($request->limit)) {
         $request->limit = sfConfig::get('app_hits_per_page');
     }
     $criteria = new Criteria();
     if (isset($this->getRoute()->resource)) {
         $this->resource = $this->getRoute()->resource;
         $criteria->add(QubitInformationObject::PARENT_ID, $this->resource->id);
     } else {
         $criteria->add(QubitInformationObject::PARENT_ID, QubitInformationObject::ROOT_ID);
     }
     if (isset($request->repositoryId)) {
         $criteria->add(QubitInformationObject::REPOSITORY_ID, $request->repositoryId);
     }
     if (isset($request->collectionType)) {
         $criteria->add(QubitInformationObject::COLLECTION_TYPE_ID, $request->collectionType);
     }
     $fallbackTable = 'QubitInformationObject';
     switch ($request->sort) {
         case 'repositoryDown':
             $fallbackTable = 'QubitActor';
             $criteria->addJoin(QubitInformationObject::REPOSITORY_ID, QubitActor::ID, Criteria::LEFT_JOIN);
             $criteria->addDescendingOrderByColumn('authorized_form_of_name');
             break;
         case 'repositoryUp':
             $fallbackTable = 'QubitActor';
             $criteria->addJoin(QubitInformationObject::REPOSITORY_ID, QubitActor::ID, Criteria::LEFT_JOIN);
             $criteria->addAscendingOrderByColumn('authorized_form_of_name');
             break;
         case 'titleDown':
             $criteria->addDescendingOrderByColumn('title');
             break;
         case 'titleUp':
             $criteria->addAscendingOrderByColumn('title');
             break;
         case 'updatedDown':
             $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         case 'updatedUp':
             $criteria->addAscendingOrderByColumn(QubitObject::UPDATED_AT);
             break;
         default:
             if (!$this->getUser()->isAuthenticated()) {
                 $criteria->addAscendingOrderByColumn('title');
             } else {
                 $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
             }
     }
     // Do source culture fallback
     $criteria = QubitCultureFallback::addFallbackCriteria($criteria, $fallbackTable);
     // Filter drafts
     $criteria = QubitAcl::addFilterDraftsCriteria($criteria);
     // Page results
     $this->pager = new QubitPager('QubitInformationObject');
     $this->pager->setCriteria($criteria);
     $this->pager->setMaxPerPage($request->limit);
     $this->pager->setPage($request->page);
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:59,代码来源:browseAction.class.php

示例6: getLastStatus

 /**
  * retrieve the last record of the emendamento_has_iter table
  * for the given emendamento
  *
  * @return OppEmIter object
  * @author Guglielmo Celata
  */
 public function getLastStatus()
 {
     $c = new Criteria();
     $c->add(OppEmendamentoHasIterPeer::EMENDAMENTO_ID, $this->getId());
     $c->addJoin(OppEmendamentoHasIterPeer::EM_ITER_ID, OppEmIterPeer::ID);
     $c->addDescendingOrderByColumn(OppEmendamentoHasIterPeer::DATA);
     $c->addDescendingOrderByColumn(OppEmendamentoHasIterPeer::CREATED_AT);
     return OppEmendamentoHasIterPeer::doSelectOne($c);
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:16,代码来源:OppEmendamento.php

示例7: getTemplateMatches

 public function getTemplateMatches()
 {
     $c = new Criteria();
     $c->add(AutodiscoveryDeviceTemplateMatchPeer::DEVICE_ID, $this->getId());
     $c->addDescendingOrderByColumn(AutodiscoveryDeviceTemplateMatchPeer::PERCENT);
     $c->addDescendingOrderByColumn(AutodiscoveryDeviceTemplateMatchPeer::COMPLEXITY);
     $matches = AutodiscoveryDeviceTemplateMatchPeer::doSelect($c);
     return $matches;
 }
开发者ID:Evolix,项目名称:lilac,代码行数:9,代码来源:AutodiscoveryDevice.php

示例8: getSubscriptions

 public function getSubscriptions($criteria = null, PropelPDO $con = null)
 {
     if (is_null($criteria)) {
         $criteria = new Criteria();
     }
     $criteria->addDescendingOrderByColumn(SubscriptionPeer::STOP);
     $criteria->addDescendingOrderByColumn(SubscriptionPeer::START);
     return parent::getSubscriptions($criteria, $con);
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:9,代码来源:Card.php

示例9: doSort

 protected function doSort()
 {
     if ($this->sortColumn) {
         $this->criteria->clearOrderByColumns();
         if ($this->sortDir === 'DESC') {
             $this->criteria->addDescendingOrderByColumn($this->sortColumn);
         } else {
             $this->criteria->addAscendingOrderByColumn($this->sortColumn);
         }
     }
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:11,代码来源:afPropelSource.class.php

示例10: retrieveLastByBulkUploadId

 /**
  * @return BulkUploadResult
  */
 public static function retrieveLastByBulkUploadId($bulkUploadId)
 {
     $criteria = new Criteria();
     $criteria->add(BulkUploadResultPeer::BULK_UPLOAD_JOB_ID, $bulkUploadId);
     $criteria->addDescendingOrderByColumn(BulkUploadResultPeer::LINE_INDEX);
     return self::doSelectOne($criteria);
 }
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:BulkUploadResultPeer.php

示例11: getByPersonId

 public static function getByPersonId($person_id)
 {
     $c = new Criteria();
     $c->add(self::PERSON_ID, $person_id);
     $c->addDescendingOrderByColumn(self::TITLE);
     return self::doSelectOne($c);
 }
开发者ID:yasirgit,项目名称:afids,代码行数:7,代码来源:RequesterPeer.php

示例12: getCalendarBusinessHours

 function getCalendarBusinessHours($CalendarUid)
 {
     $Criteria = new Criteria('workflow');
     $Criteria->clearSelectColumns();
     $Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_UID);
     $Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
     $Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
     $Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
     $Criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid, CRITERIA::EQUAL);
     $Criteria->addDescendingOrderByColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
     $Criteria->addAscendingOrderByColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
     //$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
     $rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $rs->next();
     $row = $rs->getRow();
     $fields = array();
     $count = 0;
     while (is_array($row)) {
         $count++;
         $fields[$count] = $row;
         $rs->next();
         $row = $rs->getRow();
     }
     return $fields;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:26,代码来源:CalendarBusinessHours.php

示例13: applyFilter

 public function applyFilter(Criteria $criteria_to_filter)
 {
     if (!$this->enable) {
         return;
     }
     if (!isset($criteria_to_filter->creteria_filter_attached)) {
         $criteria_to_filter->creteria_filter_attached = true;
         // copy all constraints from the criteria to $criteria_to_filter
         $columns = $this->criteria->keys();
         foreach ($columns as $column) {
             $filter_criterion = $this->criteria->getCriterion($column);
             $new_crit = $criteria_to_filter->getNewCriterion($filter_criterion->getTable() . "." . $filter_criterion->getColumn(), $filter_criterion->getValue(), $filter_criterion->getComparison());
             $existing_criterion = $criteria_to_filter->getCriterion($column);
             // don't add duplicates !!
             if ($existing_criterion && ($existing_criterion->getValue() == $filter_criterion->getValue() && $existing_criterion->getComparison() == $filter_criterion->getComparison())) {
                 continue;
             }
             // go one step deeper to copy the inner clauses
             $this->addClauses($this->criteria, $filter_criterion, $new_crit);
             $criteria_to_filter->addAnd($new_crit);
         }
         // TODO - adda more robust way to copy the orderBy from this->criteria
         $orderBy = $this->criteria->getOrderByColumns();
         if ($orderBy) {
             foreach ($orderBy as $orderByColumn) {
                 @(list($name, $order) = explode(" ", $orderByColumn));
                 if ($order == Criteria::ASC) {
                     $criteria_to_filter->addAscendingOrderByColumn($name);
                 } else {
                     $criteria_to_filter->addDescendingOrderByColumn($name);
                 }
             }
         }
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:35,代码来源:criteriaFilter.class.php

示例14: addOrderByPreorder

 public static function addOrderByPreorder(Criteria $criteria, $order = Criteria::ASC)
 {
     if ($order == Criteria::DESC) {
         return $criteria->addDescendingOrderByColumn(QubitPhysicalObject::LFT);
     }
     return $criteria->addAscendingOrderByColumn(QubitPhysicalObject::LFT);
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:7,代码来源:BasePhysicalObject.php

示例15: executeIndex

 public function executeIndex()
 {
     //perlu di rapihkan
     $field_name = $this->name;
     $reflection = new ReflectionClass($this->model . 'Peer');
     $method = $reflection->getMethod('doSelect');
     $c = new Criteria();
     $filter_field = strtoupper($this->filter_field);
     $filter_content = $this->filter_content;
     if (!empty($filter_field)) {
         if ($this->case == 'equal') {
             $c->add($reflection->getConstant($filter_field), $filter_content, Criteria::EQUAL);
         } else {
             if ($this->case == 'not_equal') {
                 $c->add($reflection->getConstant($filter_field), $filter_content, Criteria::NOT_EQUAL);
             }
         }
     }
     $order_column = $this->order_column;
     $order_type = $this->order_type;
     if (!empty($order_column)) {
         if ($order_type == 'desc') {
             $c->addDescendingOrderByColumn($order_column);
         } else {
             $c->addAscendingOrderByColumn($order_column);
         }
     }
     $reg_info = $method->invoke($method, $c);
     $this->data = $reg_info;
     $this->name = $field_name;
     $this->desc = !isset($this->desc) ? 'Name' : $this->desc;
 }
开发者ID:taryono,项目名称:school,代码行数:32,代码来源:components.class.php


注:本文中的Criteria::addDescendingOrderByColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。