summaryrefslogtreecommitdiff
path: root/zend/classimpl.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-06-11 10:45:01 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-06-11 10:45:01 +0200
commitb4936cbc31c20c390d50333da5c83ff31795acf7 (patch)
tree8e25fef14825b2be5f493249ab401b0bbc05f70d /zend/classimpl.h
parent9502a731c09593db0d3b7ad3a1d3ee90b8b44901 (diff)
when an object was created using Php::Object("MyClass", new MyClass()), the object handlers were not installed, which caused the magic methods not to be functional (issue #94)
Diffstat (limited to 'zend/classimpl.h')
-rw-r--r--zend/classimpl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/zend/classimpl.h b/zend/classimpl.h
index ec28322..bd631b8 100644
--- a/zend/classimpl.h
+++ b/zend/classimpl.h
@@ -84,6 +84,18 @@ private:
* @var std::shared_ptr
*/
std::shared_ptr<ClassImpl> _parent;
+
+ /**
+ * The object handlers for instances of this class
+ * @var zend_object_handlers
+ */
+ zend_object_handlers _handlers;
+
+ /**
+ * Are the handlers already initialized?
+ * @var bool
+ */
+ bool _initialized = false;
/**
@@ -204,6 +216,13 @@ public:
zend_object_handlers *objectHandlers();
/**
+ * Alternative way to retrieve object handlers, given a class entry
+ * @param entry
+ * @return zend_object_handlers
+ */
+ static zend_object_handlers *objectHandlers(zend_class_entry *entry);
+
+ /**
* Function to create a new iterator to iterate over an object
* @param entry The class entry
* @param object The object to iterate over