TrackManiaControl/core/Callbacks/Structures/Common/UIPropertiesBaseStructure.php

67 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2017-04-14 17:02:00 +02:00
<?php
namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\ManiaControl;
/**
* Base Structure Class for all Callbacks using a Timestamp
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
2020-01-22 10:39:35 +01:00
* @copyright 2014-2020 ManiaControl Team
2017-04-14 17:02:00 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class UIPropertiesBaseStructure extends BaseResponseStructure {
private $uiPropertiesXML;
private $uiPropertiesJson;
/**
* BaseResponseStructure constructor.
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param $data
*/
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
2017-04-14 17:02:00 +02:00
$this->uiPropertiesXML = $data[1];
$this->uiPropertiesJson = $data[2];
}
/**
* Gets the UI Properties as XML
*
* @return mixed
*/
public function getUiPropertiesXML() {
return $this->uiPropertiesXML;
}
/**
* Gets the UI Properties as Json
*
* @return mixed
*/
public function getUiPropertiesJson() {
return $this->uiPropertiesJson;
}
/**
* Gets the UI Properties as JSON Decoded Object
*
* @return mixed
*/
public function getUiPropertiesObject() {
return json_decode($this->uiPropertiesJson);
}
/**
* Gets the UI Properties as JSON Decoded Array
*
* @return mixed
*/
public function getUiPropertiesArray() {
return json_decode($this->uiPropertiesJson, true);
}
2017-04-14 17:02:00 +02:00
}