This commit is contained in:
2021-02-23 17:30:10 +08:00
parent 31d5024663
commit 5e2cf4db18
6 changed files with 33 additions and 4 deletions
+7
View File
@@ -39,6 +39,13 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
protected ActiveQuery $query;
public function clean()
{
unset($this->query, $this->model, $this->_item);
}
/**
* Collection constructor.
*
+6
View File
@@ -27,6 +27,12 @@ class CollectionIterator extends \ArrayIterator
private ActiveQuery $query;
public function clean()
{
unset($this->query);
}
/**
* CollectionIterator constructor.
* @param $model
+10
View File
@@ -51,6 +51,16 @@ class Pagination extends Component
}
public function clean()
{
unset($this->activeQuery, $this->_callback, $this->_group);
$this->_offset = 0;
$this->_limit = 100;
$this->_max = 0;
$this->_length = 0;;
}
/**
* @param array|Closure $callback
* @throws Exception
+1
View File
@@ -44,6 +44,7 @@ class Relation extends Component
* @param string $identification
* @param $localValue
* @return mixed
* @throws Exception
*/
public function first(string $identification, $localValue): mixed
{