mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-12 08:34:26 +02:00
UserSession class [5] - Refactor src/Module/ files with DI
This commit is contained in:
parent
a729f3255d
commit
eecc456e0c
78 changed files with 455 additions and 530 deletions
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace Friendica\Module\Events;
|
||||
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
|
@ -36,7 +35,7 @@ class Json extends \Friendica\BaseModule
|
|||
{
|
||||
protected function rawContent(array $request = [])
|
||||
{
|
||||
if (!Session::getLocalUser()) {
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
throw new HTTPException\UnauthorizedException();
|
||||
}
|
||||
|
||||
|
@ -70,9 +69,9 @@ class Json extends \Friendica\BaseModule
|
|||
|
||||
// get events by id or by date
|
||||
if ($event_params['event_id']) {
|
||||
$r = Event::getListById(Session::getLocalUser(), $event_params['event_id']);
|
||||
$r = Event::getListById(DI::userSession()->getLocalUserId(), $event_params['event_id']);
|
||||
} else {
|
||||
$r = Event::getListByDate(Session::getLocalUser(), $event_params);
|
||||
$r = Event::getListByDate(DI::userSession()->getLocalUserId(), $event_params);
|
||||
}
|
||||
|
||||
$links = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue