summaryrefslogtreecommitdiff
path: root/include/classbase.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-04 15:11:46 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-04 15:11:46 +0100
commit200952ad4004f6ee5527598622505adbe84df8af (patch)
treea4fb92a86730c771e36abf421835ab01861ef41c /include/classbase.h
parent59cfe935248918c1151b300eb19496b76ed579a9 (diff)
implemented cloning of objects
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/classbase.h b/include/classbase.h
index e23c579..a380840 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -98,12 +98,39 @@ public:
// done
return result;
}
+
+ /**
+ * Construct a clone of the object
+ * @param orig
+ * @param value
+ * @return Base
+ */
+ Base* clone(Base *orig, const struct _zend_object_value &value)
+ {
+ // construct the base
+ auto *result = clone(orig);
+ if (!result) return nullptr;
+
+ // assign the zend object to it
+ // @todo fix this
+// result->assign(value);
+
+ // done
+ return result;
+ }
/**
* Construct a new instance of the object
* @return Base
*/
virtual Base* construct() = 0;
+
+ /**
+ * Create a clone of an object
+ * @param orig
+ * @return Base
+ */
+ virtual Base *clone(Base *orig) = 0;
/**
* Initialize the class, given its name