public function setRequestUser (Request $request)
    {
        $request->addUserCallback ('accounts', function (Request $request) {

            $userid = $request->getSession ()->get ('catlab-user-id');

            if ($userid)
            {
                $user = MapperFactory::getUserMapper ()->getFromId ($userid);
                if ($user)
                    return $user;
            }

            return null;
        });
    }
public function setRequestUser (Request $request)
    {
        $request->addUserCallback ('accounts', function (Request $request) {

            $userid = $request->getSession ()->get ('catlab-user-id');

            if ($userid)
            {
                $user = MapperFactory::getUserMapper ()->getFromId ($userid);
                if ($user)
                    return $user;
            }

            return null;
        });
    }
public function setRequestUser ( Request $ request ) { $ request -> addUserCallback ( 'accounts' , function ( Request $ request ) { $ userid = $ request -> getSession ( ) -> get ( 'catlab-user-id' ) ; if ( $ userid ) { $ user = MapperFactory :: getUserMapper ( ) -> getFromId ( $ userid ) ; if ( $ user ) return $ user ; } return null ; } ) ; }
Set user from session
@param Request $request
@throws \Neuron\Exceptions\InvalidParameter
Set user from session