From 8f5ac5c27f81b04bb71bab930638762c8c3e501e Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 12 Jan 2010 12:56:19 +0000 Subject: closes #1145 - deprecated current "copy constructor" for all entities and implemented a clone method. The clone copies over all metadata but not annotations and private settings. It sets the guid to 0 so saving the cloned entity creates a new database record. The ownership/access of metadata is set during the save and will be the same as that of the entity. git-svn-id: http://code.elgg.org/elgg/trunk@3802 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/objects.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engine/lib/objects.php') diff --git a/engine/lib/objects.php b/engine/lib/objects.php index e4c3128b9..f2faf0d10 100644 --- a/engine/lib/objects.php +++ b/engine/lib/objects.php @@ -54,6 +54,8 @@ class ElggObject extends ElggEntity { // Is $guid is an ElggObject? Use a copy constructor else if ($guid instanceof ElggObject) { + elgg_log('This type of usage of the ElggObject constructor was deprecated in 1.7. Please use the clone method.', 'WARNING'); + foreach ($guid->attributes as $key => $value) { $this->attributes[$key] = $value; } -- cgit v1.2.3