2017-03-22 18:31:53 +01:00
|
|
|
<?php
|
|
|
|
|
2017-03-30 19:49:45 +02:00
|
|
|
namespace ManiaControl\Callbacks\Structures\Common;
|
2017-03-22 18:31:53 +01:00
|
|
|
|
|
|
|
|
2017-04-04 19:40:19 +02:00
|
|
|
use ManiaControl\General\JsonSerializable;
|
|
|
|
use ManiaControl\General\JsonSerializeTrait;
|
2017-03-26 12:56:44 +02:00
|
|
|
use ManiaControl\General\UsageInformationAble;
|
|
|
|
use ManiaControl\General\UsageInformationTrait;
|
2017-03-22 18:31:53 +01:00
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
|
2017-03-24 16:49:54 +01:00
|
|
|
/**
|
|
|
|
* Base Structure of all Callback Structures
|
|
|
|
*
|
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
|
|
|
* @copyright 2014-2017 ManiaControl Team
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
|
|
|
*/
|
2017-04-04 19:40:19 +02:00
|
|
|
abstract class BaseStructure implements UsageInformationAble, JsonSerializable {
|
|
|
|
use UsageInformationTrait, JsonSerializeTrait;
|
2017-03-26 12:56:44 +02:00
|
|
|
|
2017-03-22 18:31:53 +01:00
|
|
|
/** @var ManiaControl $maniaControl */
|
|
|
|
protected $maniaControl;
|
2017-03-23 21:04:05 +01:00
|
|
|
private $plainJsonObject;
|
2017-03-22 18:31:53 +01:00
|
|
|
|
2017-03-23 21:01:44 +01:00
|
|
|
protected function __construct(ManiaControl $maniaControl, $data) {
|
2017-03-23 21:04:05 +01:00
|
|
|
$this->maniaControl = $maniaControl;
|
|
|
|
$this->plainJsonObject = json_decode($data[0]);
|
2017-03-23 20:39:32 +01:00
|
|
|
}
|
2017-03-23 21:19:03 +01:00
|
|
|
|
2017-03-23 20:39:32 +01:00
|
|
|
/**
|
|
|
|
* Gets the Plain Json
|
|
|
|
*/
|
2017-03-23 21:04:05 +01:00
|
|
|
public function getPlainJsonObject() {
|
|
|
|
return $this->plainJsonObject;
|
2017-03-23 20:39:32 +01:00
|
|
|
}
|
2017-03-22 18:31:53 +01:00
|
|
|
}
|