TrackManiaControl/core/Callbacks/Structures/BaseStructure.php

38 lines
754 B
PHP
Raw Normal View History

<?php
/**
* Created by PhpStorm.
* User: Lukas
* Date: 22. Mär. 2017
* Time: 18:26
*/
namespace ManiaControl\Callbacks\Structures;
use ManiaControl\ManiaControl;
abstract class BaseStructure {
/** @var ManiaControl $maniaControl */
protected $maniaControl;
2017-03-23 21:04:05 +01:00
private $plainJsonObject;
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-23 20:43:23 +01:00
/**
* Var_Dump the Structure
*/
public function dump() {
var_dump(json_decode(json_encode($this)));
2017-03-23 21:01:44 +01:00
var_dump("Class Name including Namespace: " . get_class($this));
}
}