Removing countReset option from Containable as pagination support will be handled from paginate

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7006 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2008-05-22 13:43:23 +00:00
parent 5def68bf30
commit 340496079f
2 changed files with 3 additions and 8 deletions

View file

@ -61,11 +61,6 @@ class ContainableBehavior extends ModelBehavior {
*
* - autoFields: (boolean, optional) auto-add needed fields to fetch requested
* bindings. DEFAULTS TO: true
*
* - countReset: (boolean, optional) If set to false, count queries will not reset containments
* like normal queries would. Useful for using contain() and pagination.
* DEFAULTS TO: false
*
* @param object $Model Model using the behavior
* @param array $settings Settings to override for model.
@ -73,7 +68,7 @@ class ContainableBehavior extends ModelBehavior {
*/
function setup(&$Model, $settings = array()) {
if (!isset($this->settings[$Model->alias])) {
$this->settings[$Model->alias] = array('recursive' => true, 'notices' => true, 'autoFields' => true, 'countReset' => false);
$this->settings[$Model->alias] = array('recursive' => true, 'notices' => true, 'autoFields' => true);
}
$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], ife(is_array($settings), $settings, array()));
}
@ -97,7 +92,7 @@ class ContainableBehavior extends ModelBehavior {
* @access public
*/
function beforeFind(&$Model, $query) {
$reset = $this->settings[$Model->alias]['countReset'] || $Model->findQueryType != 'count';
$reset = true;
if (isset($query['reset'])) {
$reset = $query['reset'];
}

View file

@ -2971,7 +2971,7 @@ class ContainableTest extends CakeTestCase {
$Controller->params['url'] = array();
$Controller->constructClasses();
$Controller->paginate = array('Article' => array('fields' => array('title')));
$Controller->Article->contain(array('User(user)'));
$Controller->Article->contain(false, array('User(user)'));
$result = $Controller->paginate('Article');
$Controller->Article->resetBindings();
$expected = array(