public function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = []) {
		if (empty($order)) {
			$order = [];
		} elseif (!is_array($order)) {
			$order = [$order];
		}

		$sort = null;
		$direction = null;
		if (!empty($extra)) {
			$sort = Hash::get($extra, 'sort');
			$direction = Hash::get($extra, 'direction');
		}
		if (empty($direction)) {
			$direction = 'asc';
		}
		if (!empty($sort)) {
			$order[$sort] = $direction;
		}

		return $this->_searchInfo('all', $conditions, $limit, $page, $order);
	}
public function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = []) {
		if (empty($order)) {
			$order = [];
		} elseif (!is_array($order)) {
			$order = [$order];
		}

		$sort = null;
		$direction = null;
		if (!empty($extra)) {
			$sort = Hash::get($extra, 'sort');
			$direction = Hash::get($extra, 'direction');
		}
		if (empty($direction)) {
			$direction = 'asc';
		}
		if (!empty($sort)) {
			$order[$sort] = $direction;
		}

		return $this->_searchInfo('all', $conditions, $limit, $page, $order);
	}
public function paginate ( $ conditions , $ fields , $ order , $ limit , $ page = 1 , $ recursive = null , $ extra = [ ] ) { if ( empty ( $ order ) ) { $ order = [ ] ; } elseif ( ! is_array ( $ order ) ) { $ order = [ $ order ] ; } $ sort = null ; $ direction = null ; if ( ! empty ( $ extra ) ) { $ sort = Hash :: get ( $ extra , 'sort' ) ; $ direction = Hash :: get ( $ extra , 'direction' ) ; } if ( empty ( $ direction ) ) { $ direction = 'asc' ; } if ( ! empty ( $ sort ) ) { $ order [ $ sort ] = $ direction ; } return $ this -> _searchInfo ( 'all' , $ conditions , $ limit , $ page , $ order ) ; }
Return data for pagination

@param array $conditions Conditions for pagination.
@param array $fields Fields list.
@param array|string $order Sorting order.
@param int $limit Limit for pagination.
@param int $page Page number for pagination.
@param int $recursive Number of associations to recurse through during find calls.
Fetches only the first level by default.
@param array $extra Extra parametrs for pagination.
@return mixed On success array data or null|false on failure.
@see Search::_searchInfo()
Return data for pagination