diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-10 12:26:04 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-10 12:26:04 +0100 |
commit | 4872cc627642044f46ba8a8726902592a1fae05f (patch) | |
tree | a416aff6d3511b17923001a664ece1deca01b4d7 /include/base.h | |
parent | d2e10c764d1b8860dd798eda3055fc957ff556ad (diff) |
first setup for magic methods __get(), __set(), __isset() and __unset()
Diffstat (limited to 'include/base.h')
-rw-r--r-- | include/base.h | 44 |
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: /** |