Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Can't fully reset query objects. #631

Closed
wants to merge 1 commit into from

3 participants

@alanbem

select property is not cleared on ModelCriteria::clear()

@alanbem alanbem Update ModelCriteria.php
select is not cleared on ModelCriteria::clear()
dfbec66
@staabm
Collaborator

Did you check if no other property is missing..?

In general, I would not re-use objects because it is often error prune and has often no benefit over creating a new object

@willdurand
Owner

wow, magic fix spotted!

@staabm
Collaborator

Maybe a test which compares a new object with an resetted would prevent regressions...

@willdurand
Owner

ping @alanbem

@alanbem

Did you check if no other property is missing..?

Nope, I did not. I'll try to do that by tomorrow evening. I'll write some tests too.

@alanbem

new pull request is waiting #653

@alanbem alanbem closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 13, 2013
  1. @alanbem

    Update ModelCriteria.php

    alanbem authored
    select is not cleared on ModelCriteria::clear()
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  runtime/lib/query/ModelCriteria.php
View
1  runtime/lib/query/ModelCriteria.php
@@ -997,6 +997,7 @@ public function clear()
$this->with = array();
$this->primaryCriteria = null;
$this->formatter=null;
+ $this->select = null;
return $this;
}
Something went wrong with that request. Please try again.