summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 12:26:04 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 12:26:04 +0100
commit4872cc627642044f46ba8a8726902592a1fae05f (patch)
treea416aff6d3511b17923001a664ece1deca01b4d7 /include/base.h
parentd2e10c764d1b8860dd798eda3055fc957ff556ad (diff)
first setup for magic methods __get(), __set(), __isset() and __unset()
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h
index b027d5a..d944e3c 100644
--- a/include/base.h
+++ b/include/base.h
@@ -111,6 +111,50 @@ public:
{
return Value(this)[name];
}
+
+ /**
+ * Overridable method that is called to check if a property is set
+ *
+ * The default implementation does nothing, and the script will fall back
+ * to accessing the regular object properties
+ *
+ * @param key
+ * @return bool
+ */
+ virtual bool __isset(const Php::Value &key);
+
+ /**
+ * Overridable method that is called to set a new property
+ *
+ * The default implementation does nothing, and the script will fall back
+ * to accessing the regular object properties
+ *
+ * @param key
+ * @param value
+ */
+ virtual void __set(const Php::Value &key, const Php::Value &value);
+
+ /**
+ * Retrieve a property
+ *
+ * The default implementation does nothing, and the script will fall back
+ * to accessing the regular object properties
+ *
+ * @param key
+ * @return value
+ */
+ virtual Php::Value __get(const Php::Value &key);
+
+ /**
+ * Remove a member
+ *
+ * The default implementation does nothing, and the script will fall back
+ * to accessing the regular object properties
+ *
+ * @param key
+ */
+ virtual void __unset(const Php::Value &key);
+
private:
/**