summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-25 05:23:34 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-25 05:23:34 -0700
commit49ac629257835426c311fb7b92b23a9138a9d77b (patch)
treed7f8d6d843206ecdf29b3877a5e7faf7815f3f24 /include/base.h
parent9e1ecc534bace7d00a265a49018c0148a56361ae (diff)
Work in progress on implementing classes
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h
new file mode 100644
index 0000000..eceb114
--- /dev/null
+++ b/include/base.h
@@ -0,0 +1,56 @@
+/**
+ * Base class for defining your own objects
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+
+/**
+ * Namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class Base
+{
+public:
+ /**
+ * The pseudo constructor that is called from PHP after the object is constructed
+ * @param environment
+ * @param parameters
+ */
+ virtual void __construct(Environment &environment, const Parameters &parameters)
+ {
+ // call all other possible implementations
+ __construct(environment);
+ __construct(parameters);
+ __construct();
+ }
+
+ /**
+ * The pseudo constructor that is called from PHP after the object is constructed
+ * @param environment
+ */
+ virtual void __construct(Environment &environment) {}
+
+ /**
+ * The pseudo constructor that is called from PHP after the object is constructed
+ * @param parameters
+ */
+ virtual void __construct(const Parameters &parameters) {}
+
+ /**
+ * The pseudo constructor that is called from PHP after the object is constructed
+ */
+ virtual void __construct() {}
+
+
+};
+
+/**
+ * End of namespace
+ */
+}
+