Commit 8a4dffed by Carsten Brandt

fixed ActiveRelation::__clone() to work with via relation

parent 5b489aaa
......@@ -55,9 +55,11 @@ class ActiveRelation extends ActiveQuery
*/
public function __clone()
{
// make a clone of "via" object so that the same query object can be reused multiple times
if (is_object($this->via)) {
// make a clone of "via" object so that the same query object can be reused multiple times
$this->via = clone $this->via;
} elseif (is_array($this->via)) {
$this->via = [$this->via[0], clone $this->via[1]];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment