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


PHP Criteria::addAscendingOrderByColumn方法代碼示例

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


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

示例1: 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

示例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: getOrderedStudentExaminationRepprovedSubjects

 public function getOrderedStudentExaminationRepprovedSubjects()
 {
     $c = new Criteria();
     $c->addAscendingOrderByColumn(StudentExaminationRepprovedSubjectPeer::MARK);
     $c->addAscendingOrderByColumn(StudentExaminationRepprovedSubjectPeer::DATE);
     return $this->getStudentExaminationRepprovedSubjects($c);
 }
開發者ID:nvidela,項目名稱:kimkelen,代碼行數:7,代碼來源:StudentRepprovedCourseSubject.php

示例4: execute

 public function execute($request)
 {
     $this->resource = $request->getAttribute('sf_route')->resource;
     $criteria = new Criteria();
     $criteria->add(QubitEvent::ACTOR_ID, $this->resource->id);
     $criteria->addJoin(QubitEvent::INFORMATION_OBJECT_ID, QubitInformationObject::ID);
     $criteria->addAscendingOrderByColumn(QubitEvent::TYPE_ID);
     // Sort info objects alphabetically (w/ fallback)
     $criteria->addAscendingOrderByColumn('title');
     $criteria = QubitCultureFallback::addFallbackCriteria($criteria, 'QubitInformationObject');
     // Filter draft descriptions
     $criteria = QubitAcl::addFilterDraftsCriteria($criteria);
     $this->relatedInfoObjects = array();
     foreach (QubitEvent::get($criteria) as $item) {
         $this->relatedInfoObjects[$item->type->getRole()][] = $item->informationObject;
     }
     // Get "subject of" information objects (name access point)
     $criteria = new Criteria();
     $criteria->add(QubitRelation::OBJECT_ID, $this->resource->id);
     $criteria->add(QubitRelation::TYPE_ID, QubitTerm::NAME_ACCESS_POINT_ID);
     $this->subjectInfoObjects = array();
     foreach (QubitRelation::get($criteria) as $item) {
         $this->subjectInfoObjects[] = $item->subject;
     }
 }
開發者ID:nurfiantara,項目名稱:ehri-ica-atom,代碼行數:25,代碼來源:contextMenuComponent.class.php

示例5: execute

 public function execute($request)
 {
     parent::execute($request);
     $this->permissions = array();
     if (null != $this->resource->id) {
         // Get term permissions for this group
         $criteria = new Criteria();
         $criteria->addJoin(QubitAclPermission::OBJECT_ID, QubitObject::ID, Criteria::LEFT_JOIN);
         $criteria->add(QubitAclPermission::GROUP_ID, $this->resource->id);
         $c1 = $criteria->getNewCriterion(QubitAclPermission::OBJECT_ID, null, Criteria::ISNULL);
         $c2 = $criteria->getNewCriterion(QubitObject::CLASS_NAME, 'QubitTerm');
         $c1->addOr($c2);
         $criteria->add($c1);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::CONSTANTS);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::OBJECT_ID);
         if (0 < count($permissions = QubitAclPermission::get($criteria))) {
             $this->permissions = $permissions;
         }
     }
     // List of actions without create or translate
     $this->basicActions = QubitAcl::$ACTIONS;
     unset($this->basicActions['read']);
     unset($this->basicActions['translate']);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->redirect(array($this->resource, 'module' => 'aclGroup', 'action' => 'indexTermAcl'));
         }
     }
 }
開發者ID:nurfiantara,項目名稱:ehri-ica-atom,代碼行數:31,代碼來源:editTermAclAction.class.php

示例6: doSelectOrdered

 public static function doSelectOrdered()
 {
     $criteria = new Criteria();
     $criteria->addAscendingOrderByColumn(EmployeePeer::EMP_NO);
     $criteria->addAscendingOrderByColumn(EmployeePeer::NAME);
     return EmployeePeer::doSelect($criteria);
 }
開發者ID:taryono,項目名稱:school,代碼行數:7,代碼來源:EmployeePeer.php

示例7: 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

示例8: getAllOrderedByCategory

 public static function getAllOrderedByCategory()
 {
     $c = new Criteria();
     $c->addJoin(self::CATEGORY_ID, sfSimpleForumCategoryPeer::ID);
     $c->addAscendingOrderByColumn(sfSimpleForumCategoryPeer::RANK);
     $c->addAscendingOrderByColumn(self::RANK);
     return self::doSelectJoinCategoryLeftJoinPost($c);
 }
開發者ID:kriswallsmith,項目名稱:sfSimpleForumPlugin,代碼行數:8,代碼來源:PluginsfSimpleForumForumPeer.php

示例9: getMatriculats

 public function getMatriculats()
 {
     $C = new Criteria();
     $C->addAscendingOrderByColumn(MatriculesPeer::ESTAT);
     $C->addAscendingOrderByColumn(MatriculesPeer::DATAINSCRIPCIO);
     //$C->add(MatriculesPeer::CURSOS_IDCURSOS, $this->getIdcursos());
     return $this->getMatriculess($C);
 }
開發者ID:nagiro,項目名稱:hospici_cultural,代碼行數:8,代碼來源:Cursos.php

示例10: executeList

 public function executeList()
 {
     $c = new Criteria();
     $c->addAscendingOrderByColumn(PodcastPeer::TITLE);
     $c->addAscendingOrderByColumn(PodcastPeer::UPDATED_AT);
     $c->addAscendingOrderByColumn(PodcastPeer::CREATED_AT);
     $this->podcasts = PodcastPeer::doSelect($c);
 }
開發者ID:WIZARDISHUNGRY,項目名稱:sflimetracker,代碼行數:8,代碼來源:actions.class.php

示例11: doSelectJoinAnioByOrden

 public static function doSelectJoinAnioByOrden(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     //      $c->addAscendingOrderByColumn(AnioPeer::ORDEN);
     $c->addAscendingOrderByColumn(AnioPeer::DESCRIPCION);
     $c->addAscendingOrderByColumn(DivisionPeer::ORDEN);
     $c->addAscendingOrderByColumn(DivisionPeer::DESCRIPCION);
     return DivisionPeer::doSelectJoinAnio($c);
 }
開發者ID:mediasadc,項目名稱:alba,代碼行數:8,代碼來源:DivisionPeer.php

示例12: execute

 public function execute($request)
 {
     $this->resource = $this->getRoute()->resource;
     // Except for administrators, only allow users to see their own profile
     if (!$this->context->user->hasCredential('administrator')) {
         if ($this->resource->id != $this->context->user->getAttribute('user_id')) {
             $this->redirect('admin/secure');
         }
     }
     // Get user's groups
     $this->userGroups = array();
     if (0 < count($aclUserGroups = $this->resource->aclUserGroups)) {
         foreach ($aclUserGroups as $aclUserGroup) {
             $this->userGroups[] = $aclUserGroup->groupId;
         }
     } else {
         // User is *always* part of authenticated group
         $this->userGroups = array(QubitAclGroup::AUTHENTICATED_ID);
     }
     // Table width
     $this->tableCols = count($this->userGroups) + 3;
     // Get access control permissions
     $criteria = new Criteria();
     $criteria->addJoin(QubitAclPermission::OBJECT_ID, QubitObject::ID, Criteria::LEFT_JOIN);
     $c1 = $criteria->getNewCriterion(QubitAclPermission::USER_ID, $this->resource->id);
     // Add group criteria
     if (1 == count($this->userGroups)) {
         $c2 = $criteria->getNewCriterion(QubitAclPermission::GROUP_ID, $this->userGroups[0]);
     } else {
         $c2 = $criteria->getNewCriterion(QubitAclPermission::GROUP_ID, $this->userGroups, Criteria::IN);
     }
     $c1->addOr($c2);
     // Add info object criteria
     $c3 = $criteria->getNewCriterion(QubitObject::CLASS_NAME, 'QubitInformationObject');
     $c4 = $criteria->getNewCriterion(QubitAclPermission::OBJECT_ID, null, Criteria::ISNULL);
     $c3->addOr($c4);
     $c1->addAnd($c3);
     $criteria->add($c1);
     // Sort
     $criteria->addAscendingOrderByColumn(QubitAclPermission::CONSTANTS);
     $criteria->addAscendingOrderByColumn(QubitAclPermission::OBJECT_ID);
     $criteria->addAscendingOrderByColumn(QubitAclPermission::USER_ID);
     $criteria->addAscendingOrderByColumn(QubitAclPermission::GROUP_ID);
     // Add user as final "group"
     $this->userGroups[] = $this->resource->username;
     // Build ACL
     $this->acl = array();
     if (0 < count($permissions = QubitAclPermission::get($criteria))) {
         foreach ($permissions as $item) {
             // In this context permissions for all objects (null) and root actor
             // object are equivalent
             $objectId = QubitInformationObject::ROOT_ID != $item->objectId ? $item->objectId : null;
             // Use username as "group" for permissions specific to user
             $groupKey = null !== $item->groupId ? $item->groupId : $this->resource->username;
             $this->acl[$item->getConstants(array('name' => 'repositoryId'))][$objectId][$item->action][$groupKey] = $item;
         }
     }
 }
開發者ID:nurfiantara,項目名稱:ehri-ica-atom,代碼行數:58,代碼來源:indexInformationObjectAclAction.class.php

示例13: executeList

 public function executeList()
 {
     $c = new Criteria();
     //$c->add(DesignationPeer::TITLE, 'None', Criteria::NOT_EQUAL);
     $c->add(DesignationPeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(DesignationPeer::DEPARTMENT_ID);
     $c->addAscendingOrderByColumn(DesignationPeer::TITLE);
     $this->designations = DesignationPeer::doSelect($c);
 }
開發者ID:lejacome,項目名稱:hospital-mgt,代碼行數:9,代碼來源:actions.class.php

示例14: retrieveSorted

 public static function retrieveSorted(Criteria $criteria = null, PropelPDO $con = null)
 {
     if (null === $criteria) {
         $criteria = new Criteria();
     }
     $criteria->addAscendingOrderByColumn(self::LAST_NAME);
     $criteria->addAscendingOrderByColumn(self::FIRST_NAME);
     return self::doSelect($criteria, $con);
 }
開發者ID:ncuesta,項目名稱:gradebook,代碼行數:9,代碼來源:StudentPeer.php

示例15: executeList

 public function executeList()
 {
     $c = new Criteria();
     //$c->add(WardBedPeer::TITLE, 'None', Criteria::NOT_EQUAL);
     $c->add(WardBedPeer::STATUS, Constant::BED_DELETE, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(WardBedPeer::WARD_ID);
     $c->addAscendingOrderByColumn(WardBedPeer::BED);
     $this->beds = WardBedPeer::doSelect($c);
 }
開發者ID:lejacome,項目名稱:hospital-mgt,代碼行數:9,代碼來源:actions.class.php


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