/** * @param $json string * @return StormOfflinePlayer */ public static function withJson($json) { $pl = new StormOfflinePlayer(); $jsData = json_decode($json, true); $pl->loadJson($jsData); return $pl; }
protected function loadJson($data) { parent::loadJson($data->user); $this->setAuthenticated(true)->setSession($data->session); }