-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathphp_object.h
More file actions
97 lines (83 loc) · 1.95 KB
/
php_object.h
File metadata and controls
97 lines (83 loc) · 1.95 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
* PhpObject.h
*
* Class that wraps around an ecmascript object and makes it available to PHP
* userspace.
*
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2015 - 2025 Copernica B.V.
*/
/**
* Include guard
*/
#pragma once
/**
* Dependencies
*/
#include "php_base.h"
/**
* Start namespace
*/
namespace JS {
/**
* Class definition
*/
class PhpObject : public PhpBase, public Php::Traversable
{
public:
/**
* Constructor
* @param isolate The isolate
* @param object The ecmascript object
*/
PhpObject(v8::Isolate *isolate, const v8::Local<v8::Object> &object) :
PhpBase(isolate, object) {}
/**
* No copying
* @param that
*/
PhpObject(const PhpObject &that) = delete;
/**
* Destructor
*/
virtual ~PhpObject() = default;
/**
* Retrieve a property
* @param name Name of the property
* @return The requested property
*/
Php::Value __get(const Php::Value &name) const;
/**
* Change a property
* @param name Name of the property
* @param property New value for the property
*/
void __set(const Php::Value &name, const Php::Value &property);
/**
* Check if a property is set
* @param name Name of the property
* @return Is the property set
*/
bool __isset(const Php::Value &name);
/**
* Call a function
* @param name Name of the function to call
* @param params The input parameters
* @return The result of the function call
*/
Php::Value __call(const char *name, Php::Parameters ¶ms);
/**
* Cast to a string
* @return The result of the string conversion
*/
Php::Value __toString();
/**
* Retrieve the iterator
* @return The iterator
*/
virtual Php::Iterator *getIterator() override;
};
/**
* End namespace
*/
}