|
Posted by Wayne on 08/29/05 21:50
On Sat, 27 Aug 2005 12:51:45 -0400, "Kevin" <kevin@wxREMOVE4SPAM3.com>
wrote:
>Can anyone suggest a more efficient way to copy an object that doesn't
>involve writing clone methods for all it's various subclasses and component
>classes?
Because you're looking for both PHP4 and PHP5 compatibility, I assume
that all your object members are public. If so, put a __clone()
method in the base class and and get_class_vars($this) to get all the
public variables of the subclass and use that to clone each property
that contains an object.
Navigation:
[Reply to this message]
|