-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProperty.php
61 lines (55 loc) · 1.09 KB
/
Property.php
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
<?php
/**
* Google_Property
*
* @desc
* Object used to prepare JSON Objects
* @package Google
* @author Thomas Schaefer
* @since 2009-05-28
*/
/**
* Google_Property
*
* @desc
* Object used to prepare JSON Objects
* @package Google
* @author Thomas Schaefer
* @since 2009-05-28
*/
class Google_Property {
/**
* @var stdClass $properties
*/
private $properties;
/**
* constructor
* @desc receives a nested array. The array may contain further
* JQuery objects or JQuery Elements
* @param array $properties
*/
public function __construct(array $properties) {
$this->properties = new stdClass;
if(is_array($properties)) {
foreach($properties as $name => $val) {
$this->properties->{$name} = $val;
}
}
}
/**
* __set
* @desc inject further properties
* @param string $name
* @param mixed $param
*/
public function __set($name, $param) {
$this->properties->$name = $param;
}
/**
* render nested Google_Property Object to JSON
* @return string
*/
public function __toString() {
return stripslashes(Google_Base::toJSON($this->properties));
}
}