summaryrefslogtreecommitdiff
path: root/include/classbase.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-14 10:32:32 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-14 10:32:32 +0100
commit4c55148476952276ece19f5b975ca0a0233dee4c (patch)
treef16b9da14403c33f1ca951e16e58841a3d88f091 /include/classbase.h
parent159781ee8257329ca9c40306f7495a8c2f31f710 (diff)
implemented __destruct magic method
Diffstat (limited to 'include/classbase.h')
-rw-r--r--include/classbase.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/classbase.h b/include/classbase.h
index 0ea6ea4..24e8f5a 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -150,6 +150,11 @@ protected:
virtual int callCompare(Base *object1, Base *object2) const { return 1; }
/**
+ * Call the __destruct method
+ */
+ virtual Value callDestruct(Base *base) const { return nullptr; }
+
+ /**
* Call the __call(), __invoke() or __callStatic() method
* @param base Object to call on
* @param name Name of the method
@@ -283,6 +288,8 @@ private:
*/
static struct _zend_object_value createObject(struct _zend_class_entry *entry);
static struct _zend_object_value cloneObject(struct _zval_struct *val);
+ static void destructObject(struct _zend_object *object, unsigned int handle);
+ static void freeObject(struct _zend_object *object);
/**
* Static member function that get called when a method or object is called
@@ -495,6 +502,12 @@ private:
* @var std::list
*/
std::list<std::shared_ptr<Member>> _members;
+
+ /**
+ * Base object has access to the members
+ * This is needed by the Base::store() method
+ */
+ friend class Base;
};
/**