Lines Matching refs:DeepCopy

1 # DeepCopy
3 DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph.
5 [![Build Status](https://travis-ci.org/myclabs/DeepCopy.png?branch=1.x)](https://travis-ci.org/myclabs/DeepCopy)
6 [![Coverage Status](https://coveralls.io/repos/myclabs/DeepCopy/badge.png?branch=1.x)](https://coveralls.io/r/myclabs/DeepCopy?branch=1.x)
7 [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/myclabs/DeepCopy/badges/quality-score.png?s=2747100c19b275f93a777e3297c6c12d1b68b934)](https://scrutinizer-ci.com/g/myclabs/DeepCopy/)
16 1. [With `DeepCopy`](#with-deepcopy)
47 use DeepCopy\DeepCopy;
49 $copier = new DeepCopy();
84 ### With `DeepCopy`
86 ![With DeepCopy](doc/deep-copy.png)
91 DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the same object twice it
97 use function DeepCopy\deep_copy;
102 Alternatively, you can create your own `DeepCopy` instance to configure it differently for example:
105 use DeepCopy\DeepCopy;
107 $copier = new DeepCopy(true);
117 use DeepCopy\DeepCopy;
124 $copier = new DeepCopy(true);
136 The method to add a filter is `DeepCopy\DeepCopy::addFilter($filter, $matcher)`,
137 with `$filter` implementing `DeepCopy\Filter\Filter`
138 and `$matcher` implementing `DeepCopy\Matcher\Matcher`.
145 - `DeepCopy\Matcher` applies on a object attribute.
146 - `DeepCopy\TypeMatcher` applies on any element found in graph, including array elements.
154 use DeepCopy\Matcher\PropertyNameMatcher;
166 use DeepCopy\Matcher\PropertyMatcher;
179 use DeepCopy\TypeMatcher\TypeMatcher;
188 - `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher`
189 - `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher`
198 use DeepCopy\DeepCopy;
199 use DeepCopy\Filter\SetNullFilter;
200 use DeepCopy\Matcher\PropertyNameMatcher;
205 $copier = new DeepCopy();
219 use DeepCopy\DeepCopy;
220 use DeepCopy\Filter\KeepFilter;
221 use DeepCopy\Matcher\PropertyMatcher;
223 $copier = new DeepCopy();
236 use DeepCopy\DeepCopy;
237 use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter;
238 use DeepCopy\Matcher\PropertyTypeMatcher;
240 $copier = new DeepCopy();
253 use DeepCopy\DeepCopy;
254 use DeepCopy\Filter\Doctrine\DoctrineEmptyCollectionFilter;
255 use DeepCopy\Matcher\PropertyMatcher;
257 $copier = new DeepCopy();
275 use DeepCopy\DeepCopy;
276 use DeepCopy\Filter\Doctrine\DoctrineProxyFilter;
277 use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher;
279 $copier = new DeepCopy();
293 use DeepCopy\DeepCopy;
294 use DeepCopy\Filter\ReplaceFilter;
295 use DeepCopy\Matcher\PropertyMatcher;
297 $copier = new DeepCopy();
311 use DeepCopy\DeepCopy;
312 use DeepCopy\TypeFilter\ReplaceFilter;
313 use DeepCopy\TypeMatcher\TypeMatcher;
315 $copier = new DeepCopy();
332 Stop *DeepCopy* from recursively copying element, using standard `clone` instead:
335 use DeepCopy\DeepCopy;
336 use DeepCopy\TypeFilter\ShallowCopyFilter;
337 use DeepCopy\TypeMatcher\TypeMatcher;
340 $this->deepCopy = new DeepCopy();
362 DeepCopy is distributed under the MIT license.