BLUE DRAGON PHP SDK
All Classes Functions Variables Pages
rvp_php_sdk_thing.class.php
1 <?php
2 /***************************************************************************************************************************/
24 defined( 'RVP_PHP_SDK_ACCESS' ) or die ( 'Cannot Execute Directly' ); // Makes sure that this file is in the correct context.
25 
26 require_once(dirname(__FILE__).'/a_rvp_php_sdk_data_object.class.php'); // Make sure that we have the base class in place.
27 
28 /****************************************************************************************************************************/
32  /************************************************************************************************************************/
33  /*#################################################### INTERNAL METHODS ################################################*/
34  /************************************************************************************************************************/
35  /***********************/
39  protected function _save_data( $in_args = '',
40  $in_payload = NULL,
41  $in_new_child_ids = NULL
42  ) {
43  $to_set = [
44  'key' => (isset($this->_object_data->key) ? trim($this->_object_data->key) : NULL),
45  'description' => (isset($this->_object_data->description) ? trim($this->_object_data->description) : NULL),
46  'tag2' => (isset($this->_object_data->tag2) ? $this->_object_data->tag2 : NULL),
47  'tag3' => (isset($this->_object_data->tag3) ? $this->_object_data->tag3 : NULL),
48  'tag4' => (isset($this->_object_data->tag4) ? $this->_object_data->tag4 : NULL),
49  'tag5' => (isset($this->_object_data->tag5) ? $this->_object_data->tag5 : NULL),
50  'tag6' => (isset($this->_object_data->tag6) ? $this->_object_data->tag6 : NULL),
51  'tag7' => (isset($this->_object_data->tag7) ? $this->_object_data->tag7 : NULL),
52  'tag8' => (isset($this->_object_data->tag8) ? $this->_object_data->tag8 : NULL),
53  'tag9' => (isset($this->_object_data->tag9) ? $this->_object_data->tag9 : NULL)
54  ];
55 
56  $put_args = '';
57 
58  foreach ($to_set as $key => $value) {
59  if (isset($key) && isset($value)) {
60  $put_args .= '&'.$key.'='.urlencode(trim(strval($value)));
61  }
62  }
63 
64  $ret = parent::_save_data($put_args.$in_args, NULL, NULL);
65 
66  return $ret;
67  }
68 
69  /***********************/
75  protected function _save_change_record( $in_change_record_object
76  ) {
77  $ret = false;
78 
79  if (isset($in_change_record_object->things)) {
80  if (isset($in_change_record_object->things->changed_things)) {
81  if (is_array($in_change_record_object->things->changed_things)) {
82  if (count($in_change_record_object->things->changed_things)) {
83  foreach ($in_change_record_object->things->changed_things as $changed_thing) {
84  if ($before = $changed_thing->before) {
85  $this->_changed_states[] = new RVP_PHP_SDK_Thing($this->_sdk_object, $before->id, $before, true);
86  $ret = true;
87  }
88  }
89  }
90  }
91  }
92  }
93 
94  return $ret;
95  }
96 
97  /***********************/
103  protected function _load_data( $in_force = false,
104  $in_details = false,
105  $in_parents = false
106  ) {
107  $ret = parent::_load_data($in_force, $in_details, $in_parents);
108 
109  if ($ret) {
110  if (isset($this->_object_data) && isset($this->_object_data->things) && is_array($this->_object_data->things) && (1 == count($this->_object_data->things))) {
111  $this->_object_data = $this->_object_data->things[0];
112  } else {
113  $this->_object_data = NULL;
114  $this->_details = false;
115  }
116  }
117 
118  return $ret;
119  }
120 
121  /************************************************************************************************************************/
122  /*#################################################### PUBLIC METHODS ##################################################*/
123  /************************************************************************************************************************/
124  /***********************/
127  function __construct( $in_sdk_object,
128  $in_id,
129  $in_data = NULL,
130  $in_detailed_data = false
131  ) {
132  parent::__construct($in_sdk_object, $in_id, $in_data, $in_detailed_data, 'things');
133  }
134 
135  /***********************/
141  function key() {
142  $ret = NULL;
143 
144  $this->_load_data(false, true);
145 
146  if (isset($this->_object_data) && isset($this->_object_data->key)) {
147  $ret = $this->_object_data->key;
148  }
149 
150  return $ret;
151  }
152 
153  /***********************/
159  function set_key( $in_new_string_value
160  ) {
161  $ret = false;
162 
163  $this->_load_data(false, true);
164 
165  if (isset($this->_object_data)) {
166  $this->_object_data->key = trim(strval($in_new_string_value));
167  $ret = $this->save_data();
168  }
169 
170  return $ret;
171  }
172 
173  /***********************/
179  function description() {
180  $ret = NULL;
181 
182  $this->_load_data(false, true);
183 
184  if (isset($this->_object_data) && isset($this->_object_data->key)) {
185  $ret = $this->_object_data->description;
186  }
187 
188  return $ret;
189  }
190 
191  /***********************/
197  function set_description( $in_new_string_value
198  ) {
199  $ret = false;
200 
201  $this->_load_data(false, true);
202 
203  if (isset($this->_object_data)) {
204  $this->_object_data->description = trim(strval($in_new_string_value));
205  $ret = $this->save_data();
206  }
207 
208  return $ret;
209  }
210 
211  /***********************/
217  function tag2() {
218  $ret = NULL;
219 
220  $this->_load_data(false, true);
221 
222  if (isset($this->_object_data)) {
223  $ret = $this->_object_data->tag2;
224  }
225 
226  return $ret;
227  }
228 
229  /***********************/
235  function set_tag2( $in_new_string_value
236  ) {
237  $ret = false;
238 
239  $this->_load_data(false, true);
240 
241  if (isset($this->_object_data)) {
242  $this->_object_data->tag2 = trim(strval($in_new_string_value));
243  $ret = $this->save_data();
244  }
245 
246  return $ret;
247  }
248 
249  /***********************/
255  function tag3() {
256  $ret = NULL;
257 
258  $this->_load_data(false, true);
259 
260  if (isset($this->_object_data)) {
261  $ret = $this->_object_data->tag3;
262  }
263 
264  return $ret;
265  }
266 
267  /***********************/
273  function set_tag3( $in_new_string_value
274  ) {
275  $ret = false;
276 
277  $this->_load_data(false, true);
278 
279  if (isset($this->_object_data)) {
280  $this->_object_data->tag3 = trim(strval($in_new_string_value));
281  $ret = $this->save_data();
282  }
283 
284  return $ret;
285  }
286 
287  /***********************/
293  function tag4() {
294  $ret = NULL;
295 
296  $this->_load_data(false, true);
297 
298  if (isset($this->_object_data)) {
299  $ret = $this->_object_data->tag4;
300  }
301 
302  return $ret;
303  }
304 
305  /***********************/
311  function set_tag4( $in_new_string_value
312  ) {
313  $ret = false;
314 
315  $this->_load_data(false, true);
316 
317  if (isset($this->_object_data)) {
318  $this->_object_data->tag4 = trim(strval($in_new_string_value));
319  $ret = $this->save_data();
320  }
321 
322  return $ret;
323  }
324 
325  /***********************/
331  function tag5() {
332  $ret = NULL;
333 
334  $this->_load_data(false, true);
335 
336  if (isset($this->_object_data)) {
337  $ret = $this->_object_data->tag5;
338  }
339 
340  return $ret;
341  }
342 
343  /***********************/
349  function set_tag5( $in_new_string_value
350  ) {
351  $ret = false;
352 
353  $this->_load_data(false, true);
354 
355  if (isset($this->_object_data)) {
356  $this->_object_data->tag5 = trim(strval($in_new_string_value));
357  $ret = $this->save_data();
358  }
359 
360  return $ret;
361  }
362 
363  /***********************/
369  function tag6() {
370  $ret = NULL;
371 
372  $this->_load_data(false, true);
373 
374  if (isset($this->_object_data)) {
375  $ret = $this->_object_data->tag6;
376  }
377 
378  return $ret;
379  }
380 
381  /***********************/
387  function set_tag6( $in_new_string_value
388  ) {
389  $ret = false;
390 
391  $this->_load_data(false, true);
392 
393  if (isset($this->_object_data)) {
394  $this->_object_data->tag6 = trim(strval($in_new_string_value));
395  $ret = $this->save_data();
396  }
397 
398  return $ret;
399  }
400 
401  /***********************/
407  function tag7() {
408  $ret = NULL;
409 
410  $this->_load_data(false, true);
411 
412  if (isset($this->_object_data)) {
413  $ret = $this->_object_data->tag7;
414  }
415 
416  return $ret;
417  }
418 
419  /***********************/
425  function set_tag7( $in_new_string_value
426  ) {
427  $ret = false;
428 
429  $this->_load_data(false, true);
430 
431  if (isset($this->_object_data)) {
432  $this->_object_data->tag7 = trim(strval($in_new_string_value));
433  $ret = $this->save_data();
434  }
435 
436  return $ret;
437  }
438 
439  /***********************/
445  function tag8() {
446  $ret = NULL;
447 
448  $this->_load_data(false, true);
449 
450  if (isset($this->_object_data)) {
451  $ret = $this->_object_data->tag8;
452  }
453 
454  return $ret;
455  }
456 
457  /***********************/
463  function set_tag8( $in_new_string_value
464  ) {
465  $ret = false;
466 
467  $this->_load_data(false, true);
468 
469  if (isset($this->_object_data)) {
470  $this->_object_data->tag8 = trim(strval($in_new_string_value));
471  $ret = $this->save_data();
472  }
473 
474  return $ret;
475  }
476 
477  /***********************/
483  function tag9() {
484  $ret = NULL;
485 
486  $this->_load_data(false, true);
487 
488  if (isset($this->_object_data)) {
489  $ret = $this->_object_data->tag9;
490  }
491 
492  return $ret;
493  }
494 
495  /***********************/
501  function set_tag9( $in_new_string_value
502  ) {
503  $ret = false;
504 
505  $this->_load_data(false, true);
506 
507  if (isset($this->_object_data)) {
508  $this->_object_data->tag9 = trim(strval($in_new_string_value));
509  $ret = $this->save_data();
510  }
511 
512  return $ret;
513  }
514 };
set_tag3( $in_new_string_value)
set_tag7( $in_new_string_value)
_load_data( $in_force=false, $in_details=false, $in_parents=false)
__construct( $in_sdk_object, $in_id, $in_data=NULL, $in_detailed_data=false)
set_key( $in_new_string_value)
set_tag5( $in_new_string_value)
set_tag2( $in_new_string_value)
set_tag8( $in_new_string_value)
set_tag4( $in_new_string_value)
set_tag9( $in_new_string_value)
_save_change_record( $in_change_record_object)
set_tag6( $in_new_string_value)
_save_data( $in_args='', $in_payload=NULL, $in_new_child_ids=NULL)
set_description( $in_new_string_value)