1 | <?php |
||
19 | class ElggUpgrade extends \ElggObject { |
||
20 | private $requiredProperties = array( |
||
21 | 'title', |
||
22 | 'description', |
||
23 | 'upgrade_url', |
||
24 | ); |
||
25 | |||
26 | /** |
||
27 | * Do not use. |
||
28 | * |
||
29 | * @access private |
||
30 | * @var callable |
||
31 | */ |
||
32 | public $_callable_egefps = 'elgg_get_entities_from_private_settings'; |
||
33 | |||
34 | /** |
||
35 | * Set subtype to upgrade |
||
36 | * |
||
37 | * @return null |
||
38 | */ |
||
39 | 9 | public function initializeAttributes() { |
|
51 | |||
52 | /** |
||
53 | * Mark this upgrade as completed |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function setCompleted() { |
||
61 | |||
62 | /** |
||
63 | * Has this upgrade completed? |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function isCompleted() { |
||
70 | |||
71 | /** |
||
72 | * Sets an upgrade URL path |
||
73 | * |
||
74 | * @param string $path Set the URL path (without site URL) for the upgrade page |
||
75 | * @return void |
||
76 | * @throws InvalidArgumentException |
||
77 | */ |
||
78 | 5 | public function setPath($path) { |
|
91 | |||
92 | /** |
||
93 | * Returns a normalized URL for the upgrade page. |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | 1 | public function getURL() { |
|
100 | |||
101 | /** |
||
102 | * Sets the timestamp for when the upgrade completed. |
||
103 | * |
||
104 | * @param int $time Timestamp when upgrade finished. Defaults to now. |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function setCompletedTime($time = null) { |
||
114 | |||
115 | /** |
||
116 | * Gets the time when the upgrade completed. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getCompletedTime() { |
||
123 | |||
124 | /** |
||
125 | * Require an upgrade page. |
||
126 | * |
||
127 | * @return mixed |
||
128 | * @throws UnexpectedValueException |
||
129 | */ |
||
130 | 3 | public function save() { |
|
139 | |||
140 | /** |
||
141 | * Set a value as private setting or attribute. |
||
142 | * |
||
143 | * Attributes include title and description. |
||
144 | * |
||
145 | * @param string $name Name of the attribute or private_setting |
||
146 | * @param mixed $value Value to be set |
||
147 | * @return void |
||
148 | */ |
||
149 | 9 | public function __set($name, $value) { |
|
156 | |||
157 | /** |
||
158 | * Get an attribute or private setting value |
||
159 | * |
||
160 | * @param string $name Name of the attribute or private setting |
||
161 | * @return mixed |
||
162 | */ |
||
163 | 9 | public function __get($name) { |
|
171 | |||
172 | /** |
||
173 | * Find an ElggUpgrade object by the unique URL path |
||
174 | * |
||
175 | * @param string $path The Upgrade URL path (after site URL) |
||
176 | * @return ElggUpgrade|false |
||
177 | */ |
||
178 | 6 | public function getUpgradeFromPath($path) { |
|
210 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: