protected function setOrderAndSegmentation() { $this->setExternalSorting(true); $this->setExternalSegmentation(true); if (!$this->getDefaultOrderField()) { $this->setDefaultOrderField($this->active_record_list->getAR()->getArFieldList()->getPrimaryField()->getName()); } $this->determineLimit(); $this->determineOffsetAndOrder(); $this->setMaxCount($this->active_record_list->count()); $this->active_record_list->orderBy($this->getOrderField(), $this->getOrderDirection()); $this->active_record_list->limit($this->getOffset(), $this->getLimit()); }
/** * @param $orderBy * @param string $orderDirection * * @return ActiveRecordList */ public static function orderBy($orderBy, $orderDirection = 'ASC') { $srModelObjectList = new ActiveRecordList(self::getCalledClass()); $srModelObjectList->orderBy($orderBy, $orderDirection); return $srModelObjectList; }