summaryrefslogtreecommitdiff
path: root/src/base.cpp
blob: b5f2f860e48c49d20b66c29def89b790ddfc7438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 *  Base.cpp
 *
 *  Implementation of the base class
 *
 *  @documentation private
 */
#include "includes.h"

/**
 *  Set up namespace
 */
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
 */
}