1 | <?php |
||
9 | class UqlFunction implements \JsonSerializable |
||
10 | { |
||
11 | /** |
||
12 | * Instance to which this function/method belongs |
||
13 | */ |
||
14 | private $instance; |
||
15 | |||
16 | /** |
||
17 | * Name of the method in the instance where its defined |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private $method; |
||
22 | |||
23 | /** |
||
24 | * Name by which this function will be known inside UQL |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $name; |
||
29 | |||
30 | public function __construct($name, $instance, $method) |
||
36 | |||
37 | /** |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function getInstance() |
||
44 | |||
45 | /** |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function getMethod() |
||
52 | |||
53 | /** |
||
54 | * @return mixed |
||
55 | */ |
||
56 | public function getName() |
||
60 | |||
61 | /** |
||
62 | * Performs the call to the function defined by this FunctionExtension |
||
63 | * |
||
64 | * @param $arguments |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function call($arguments) |
||
72 | |||
73 | /** |
||
74 | * Returns a readable string representation of the function, of the standard form: |
||
75 | * |
||
76 | * functionName(argument1, argument2, [optionalArgument1 = defaultValue, [optionalNullableArgument2]]) |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function __toString() |
||
108 | |||
109 | /** |
||
110 | * (PHP 5 >= 5.4.0)<br/> |
||
111 | * Specify data which should be serialized to JSON |
||
112 | * |
||
113 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
114 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
115 | * which is a value of any type other than a resource. |
||
116 | */ |
||
117 | public function jsonSerialize() |
||
151 | } |
||
152 |