Browse Source

Add finder options to Paginator->paginate method

The paginator right now doesn't send $options to any finder, custom or otherwise. This change allows setting 'finderOptions' directly from the controller's paginate array.
Patrick Conroy 11 years ago
parent
commit
4d5d3e1fb2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Controller/Component/PaginatorComponent.php

+ 1 - 1
src/Controller/Component/PaginatorComponent.php

@@ -164,7 +164,7 @@ class PaginatorComponent extends Component {
 		unset($options['finder'], $options['maxLimit']);
 
 		if (empty($query)) {
-			$query = $object->find($type);
+			$query = $object->find($type, isset($options['finderOptions']) ? $options['finderOptions'] : []);
 		}
 
 		$query->applyOptions($options);