Lines Matching refs:DeepCopy

1 # DeepCopy  chapter
3 DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in …
5 …Build Status](https://travis-ci.org/myclabs/DeepCopy.png?branch=1.x)](https://travis-ci.org/myclab…
6 …atus](https://coveralls.io/repos/myclabs/DeepCopy/badge.png?branch=1.x)](https://coveralls.io/r/my…
7 …com/g/myclabs/DeepCopy/badges/quality-score.png?s=2747100c19b275f93a777e3297c6c12d1b68b934)](https…
12 [2.x](https://github.com/myclabs/DeepCopy/tree/2.x) version.**
21 1. [With `DeepCopy`](#with-deepcopy)
52 use DeepCopy\DeepCopy;
54 $copier = new DeepCopy();
89 ### With `DeepCopy`
91 ![With DeepCopy](doc/deep-copy.png)
96 DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the sa…
102 use function DeepCopy\deep_copy;
107 Alternatively, you can create your own `DeepCopy` instance to configure it differently for example:
110 use DeepCopy\DeepCopy;
112 $copier = new DeepCopy(true);
122 use DeepCopy\DeepCopy;
129 $copier = new DeepCopy(true);
141 The method to add a filter is `DeepCopy\DeepCopy::addFilter($filter, $matcher)`,
142 with `$filter` implementing `DeepCopy\Filter\Filter`
143 and `$matcher` implementing `DeepCopy\Matcher\Matcher`.
150 - `DeepCopy\Matcher` applies on a object attribute.
151 - `DeepCopy\TypeMatcher` applies on any element found in graph, including array elements.
159 use DeepCopy\Matcher\PropertyNameMatcher;
171 use DeepCopy\Matcher\PropertyMatcher;
184 use DeepCopy\TypeMatcher\TypeMatcher;
193 - `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher`
194 - `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher`
203 use DeepCopy\DeepCopy;
204 use DeepCopy\Filter\SetNullFilter;
205 use DeepCopy\Matcher\PropertyNameMatcher;
210 $copier = new DeepCopy();
224 use DeepCopy\DeepCopy;
225 use DeepCopy\Filter\KeepFilter;
226 use DeepCopy\Matcher\PropertyMatcher;
228 $copier = new DeepCopy();
241 use DeepCopy\DeepCopy;
242 use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter;
243 use DeepCopy\Matcher\PropertyTypeMatcher;
245 $copier = new DeepCopy();
258 use DeepCopy\DeepCopy;
259 use DeepCopy\Filter\Doctrine\DoctrineEmptyCollectionFilter;
260 use DeepCopy\Matcher\PropertyMatcher;
262 $copier = new DeepCopy();
280 use DeepCopy\DeepCopy;
281 use DeepCopy\Filter\Doctrine\DoctrineProxyFilter;
282 use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher;
284 $copier = new DeepCopy();
298 use DeepCopy\DeepCopy;
299 use DeepCopy\Filter\ReplaceFilter;
300 use DeepCopy\Matcher\PropertyMatcher;
302 $copier = new DeepCopy();
316 use DeepCopy\DeepCopy;
317 use DeepCopy\TypeFilter\ReplaceFilter;
318 use DeepCopy\TypeMatcher\TypeMatcher;
320 $copier = new DeepCopy();
337 Stop *DeepCopy* from recursively copying element, using standard `clone` instead:
340 use DeepCopy\DeepCopy;
341 use DeepCopy\TypeFilter\ShallowCopyFilter;
342 use DeepCopy\TypeMatcher\TypeMatcher;
345 $this->deepCopy = new DeepCopy();
367 DeepCopy is distributed under the MIT license.