Sulu\Bundle\MediaBundle\Media\Manager\MediaManager::getCurrentUser PHP Method

getCurrentUser() protected method

Returns current user or null if no user is loggedin.
protected getCurrentUser ( ) : Sulu\Component\Security\Authentication\UserInterface | void
return Sulu\Component\Security\Authentication\UserInterface | void
    protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }
        if (!$this->tokenStorage->getToken()) {
            return;
        }
        return $this->tokenStorage->getToken()->getUser();
    }