DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph. How do you create deep copies of your objects (i.e. copying also all the objects referenced in the properties)? You use __clone() and implement the behavior yourself. DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the same object twice it keeps a hash map of all instances and thus preserves the object graph. Alternatively, you can create your own DeepCopy instance to configure it differently. You may want to roll your own deep copy function. You can add filters to customize the copy process. DeepCopy\Matcher applies on a object attribute. DeepCopy\TypeMatcher applies on any element found in graph, including array elements. The PropertyNameMatcher will match a property by its name.

Features

  • Implement your own cloning method
  • Use a filter with a type matcher
  • Roll your own deep copy function
  • Add filters to customize the copy process
  • Provides some generic filters and matchers

Project Samples

Project Activity

See All Activity >

Categories

Object Oriented

License

MIT License

Follow DeepCopy

DeepCopy Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of DeepCopy!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Object Oriented Software

Registered

2021-07-19