This commit is contained in:
2021-02-23 19:15:39 +08:00
parent 5fd07c2327
commit 074762cdae
5 changed files with 36 additions and 3 deletions
+9
View File
@@ -46,6 +46,15 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
} }
/**
* recover class by clone
*/
public function __clone()
{
$this->clean();
}
/** /**
* Collection constructor. * Collection constructor.
* *
+1 -3
View File
@@ -98,12 +98,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
/** /**
* * recover class by clone
* @throws ComponentException
*/ */
public function __clone() public function __clone()
{ {
$this->error('__clone ' . get_called_class());
$this->clean(); $this->clean();
} }
+9
View File
@@ -33,6 +33,15 @@ class CollectionIterator extends \ArrayIterator
} }
/**
* recover class by clone
*/
public function __clone()
{
$this->clean();
}
/** /**
* CollectionIterator constructor. * CollectionIterator constructor.
* @param $model * @param $model
+9
View File
@@ -61,6 +61,15 @@ class Pagination extends Component
} }
/**
* recover class by clone
*/
public function __clone()
{
$this->clean();
}
/** /**
* @param array|Closure $callback * @param array|Closure $callback
* @throws Exception * @throws Exception
+8
View File
@@ -171,6 +171,14 @@ class Event extends BaseObject
} }
/**
* recover class by clone
*/
public function __clone()
{
$this->clean();
}
/** /**
* @param $name * @param $name
* @param array $params * @param array $params