diff --git a/Database/Base/AbstractCollection.php b/Database/Base/AbstractCollection.php index 1493bf29..5b164ecf 100644 --- a/Database/Base/AbstractCollection.php +++ b/Database/Base/AbstractCollection.php @@ -46,6 +46,15 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat } + /** + * recover class by clone + */ + public function __clone() + { + $this->clean(); + } + + /** * Collection constructor. * diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 4497ec10..e62ee380 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -98,12 +98,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess /** - * - * @throws ComponentException + * recover class by clone */ public function __clone() { - $this->error('__clone ' . get_called_class()); $this->clean(); } diff --git a/Database/Base/CollectionIterator.php b/Database/Base/CollectionIterator.php index 220cec04..083ddbae 100644 --- a/Database/Base/CollectionIterator.php +++ b/Database/Base/CollectionIterator.php @@ -33,6 +33,15 @@ class CollectionIterator extends \ArrayIterator } + /** + * recover class by clone + */ + public function __clone() + { + $this->clean(); + } + + /** * CollectionIterator constructor. * @param $model diff --git a/Database/Pagination.php b/Database/Pagination.php index d57cf692..9b885677 100644 --- a/Database/Pagination.php +++ b/Database/Pagination.php @@ -61,6 +61,15 @@ class Pagination extends Component } + /** + * recover class by clone + */ + public function __clone() + { + $this->clean(); + } + + /** * @param array|Closure $callback * @throws Exception diff --git a/System/Event.php b/System/Event.php index 3f522334..288b8826 100644 --- a/System/Event.php +++ b/System/Event.php @@ -171,6 +171,14 @@ class Event extends BaseObject } + /** + * recover class by clone + */ + public function __clone() + { + $this->clean(); + } + /** * @param $name * @param array $params