public function __construct(\Rebond\App $app) { if ($app->site()->getStatus() == \Rebond\Core\StatusType::INACTIVE) { if ($app->ajax()) { return ['result' => ResultType::ERROR, 'message' => Lang::lang('error.maintenance')]; } else { Util\Session::redirect('/error/maintenance'); } } parent::__construct($app); if ($this->signedUser->getId() != 0) { $options = ['where' => [['id = ?', $this->signedUser->getId()]]]; $this->player = \Own\Bus\Player\Data::load($options); if ($this->player == null) { $this->player = \Own\Bus\Player\Service::create($this->signedUser); } } else { $this->player = new \Own\Bus\Player\Model(); } }