summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 60e8c2d..b5f2f86 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -13,6 +13,20 @@
namespace Php {
/**
+ * Convert the object to a Php::Value object (how it is used externally)
+ * @return Value
+ */
+Value Base::value() const
+{
+ // because the object is stored in a MixedObject, we know that the zend_object
+ // structure is right in front of the this pointer
+ zend_object *object = (zend_object *)this - sizeof(zend_object);
+
+ // wrap the properties table, as a reference
+ return Object(*object->properties_table, true);
+}
+
+/**
* End of namespace
*/
}