diff options
Diffstat (limited to 'include/classbase.h')
-rw-r--r-- | include/classbase.h | 17 |
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 |