summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-11 14:14:12 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-11 14:14:12 +0100
commitfc5c9305507f8eb899070b0d6d72ddb27c3bfc0f (patch)
tree59228bf56f74a8be1179c3cc45c25efcfda2295d /src/base.cpp
parentcdf237fb05c396d258c2c82a441a2f9b4deff282 (diff)
implemented __call() function
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp
index b561899..85cb85c 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -144,6 +144,27 @@ void Base::__unset(const Php::Value &key)
}
/**
+ * Call a method
+ *
+ * This method is called when a method is called from the PHP script that
+ * was not explicitly defined. You can use this to catch variable method
+ * names, or to support all thinkable method names.
+ *
+ * @param method Name of the method that was called
+ * @param params The parameters that were passed to the function
+ * @return Value The return value
+ */
+Value Base::__call(const char *method, Parameters &params)
+{
+ // throw an exception that will be caught in the ClassBase class,
+ // so that the default implementation of the function can be called
+ throw NotImplemented();
+
+ // unreachable code
+ return nullptr;
+}
+
+/**
* End namespace
*/
}