summaryrefslogtreecommitdiff
path: root/include/classbase.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 12:00:11 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 12:00:11 +0100
commit41bd759f31d625b5f73dd3a31d76a91efbde8ad7 (patch)
treeb995cc0c295c031c6cf130fe0f4f51b286a0511e /include/classbase.h
parent52fe0c39457421e075959179ee6b64a20b96f0d9 (diff)
working implementation for Base::value()
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/classbase.h b/include/classbase.h
index 249122a..a9d9ef5 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -76,6 +76,23 @@ public:
* Destructor
*/
virtual ~ClassBase();
+
+ /**
+ * Construct a new instance of the object
+ * @return Base
+ */
+ Base* construct(struct _zend_object *object)
+ {
+ // construct the base
+ auto *result = construct();
+ if (!result) return nullptr;
+
+ // assign the zend object to it
+ result->assign(object);
+
+ // done
+ return result;
+ }
/**
* Construct a new instance of the object