advanced callback structure

This commit is contained in:
kremsy
2017-03-23 20:39:32 +01:00
parent 8ab5d384da
commit 2faa78c8e2
6 changed files with 44 additions and 18 deletions

View File

@@ -14,12 +14,38 @@ use ManiaControl\ManiaControl;
abstract class BaseStructure {
/** @var ManiaControl $maniaControl */
protected $maniaControl;
private $plainJson;
/**
* Sets ManiaControl
*
* @param \ManiaControl\ManiaControl $maniaControl
*/
protected function setManiaControl(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
}
/**
* Decodes the Data and Sets the Json
*
* @param array $data
*/
protected function setJson($data) {
$this->plainJson = json_decode($data[0]);
}
/**
* Gets the Plain Json
*/
public function getJson() {
return $this->plainJson;
}
/**
* Var_Dump the Structure
*/
public function dump() {
var_dump($this->getJson());
var_dump(json_decode(json_encode($this)));
}
}