02.04
php
hiromi2424
Note
patch for paginator to be able to order calclational colmun.
patch for paginator to be able to order calclational colmun.
- $whitelist = $scope;
- $scope = $object;
- $object = null;
- }
- $assoc = null;
- $assoc = null;
- }
- $object =& $this->{$object}->{$assoc};
- $object =& $this->{$this->modelClass}->{$assoc};
- $object =& $this->{$object};
- $object =& $this->{$this->modelClass}->{$object};
- }
- $object =& $this->{$this->modelClass};
- } else {
- $className = null;
- $name = $this->uses[0];
- }
- if ($className) {
- $object =& $this->{$className};
- } else {
- $object =& $this->{$name};
- }
- }
- }
- trigger_error(sprintf(__('Controller::paginate() - can\'t find model %1$s in controller %2$sController', true), $object, $this->name), E_USER_WARNING);
- }
- $defaults = $this->paginate[$object->alias];
- } else {
- $defaults = $this->paginate;
- }
- $options['limit'] = $options['show'];
- }
- $direction = null;
- }
- if ($direction != 'asc' && $direction != 'desc') {
- $direction = 'asc';
- }
- }
- $alias = $object->alias ;
- }
- $value = $options['order'][$key];
- $options['order'][$alias . '.' . $field] = $value;
- } elseif ($object->hasField($field)) {
- $options['order'][$alias . '.' . $field] = $value;
- } else{
- $_fieldAlias = $_field;
- $regex = '/\s+as\s+/';
- }
- if($_field === null){
- $_field = $_alias;
- }
- if($field === $_field || $field === $_fieldAlias){
- $options['order'][$field] = $value;
- }
- }
- }
- }
- for ($i = 0; $i < $count; $i++) {
- }
- }
- }
- $conditions = $fields = $order = $limit = $page = $recursive = null;
- }
- $type = 'all';
- $type = $defaults[0];
- }
- }
- if ($recursive === null) {
- $recursive = $object->recursive;
- }
- 'conditions', 'fields', 'order', 'limit', 'page', 'recursive'
- ));
- if ($type !== 'all') {
- $extra['type'] = $type;
- }
- $count = $object->paginateCount($conditions, $recursive, $extra);
- } else {
- if ($recursive != $object->recursive) {
- $parameters['recursive'] = $recursive;
- }
- }
- if ($page === 'last' || $page >= $pageCount) {
- $options['page'] = $page = $pageCount;
- $options['page'] = $page = 1;
- }
- $page = $options['page'] = (integer)$page;
- $results = $object->paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra);
- } else {
- if ($recursive != $object->recursive) {
- $parameters['recursive'] = $recursive;
- }
- }
- 'page' => $page,
- 'count' => $count,
- 'prevPage' => ($page > 1),
- 'nextPage' => ($count > ($page * $limit)),
- 'pageCount' => $pageCount,
- 'options' => $options
- );
- $this->params['paging'][$object->alias] = $paging;
- $this->helpers[] = 'Paginator';
- }
- return $results;
- }
Parsed in 0.340 seconds, using GeSHi 1.0.7.14