blob: 797aff6305c7808cce8e8d5be6ea518d8a990234 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/**
* 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:
/**
* Virtual destructor
*/
virtual ~Base() {}
/**
* The pseudo constructor that is called from PHP after the object is constructed
* @param environment
* @param parameters
*/
virtual void __construct(Environment &environment, const Parameters ¶meters)
{
// 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 ¶meters) {}
/**
* The pseudo constructor that is called from PHP after the object is constructed
*/
virtual void __construct() {}
/**
* The pseudo destructor that is called from PHP right before the object is destructed
* @param environment
*/
virtual void __destruct(Environment &environment)
{
// call the other implementation
__destruct();
}
/**
* The pseudo destructor that is called from PHP right before the object is destructed
*/
virtual void __destruct() {}
};
/**
* End of namespace
*/
}
|