[FLOW3-general] Get a user from the userRepository

Sergio naguib.mahfuz at gmail.com
Thu Dec 20 13:26:01 CET 2012


Thanks, David, for your suggestion.

Anyway, despite I have the $myUser object as you said, I do something like
that:

$this->view->assign('users', $user);

to have all the user information in my view, but it throws an exception. I
was supposed to look for this $myUser in the user repository. This lists
all:

$this->view->assign('users', $this->userRepository->findAll());

But I just want ONLY this user, so that's why I was thinking to use
something like the mail of the user, but even this way, I can't get it :-(



2012/12/20 David Sporer <david.sporer at gmail.com>

> Hi,
>
> if your User model extends the Person class this should be enough:
>
> $myUser = $this->securityContext->getAccount()->getParty();
>
> The party in this case should be your User object of the currently
> logged in account.
>
>
> Regards
>
> David
>
>
>
> 2012/12/20 Sergio <naguib.mahfuz at gmail.com>
>
> > Good morning,
> >
> > I was just trying to find a user in the userRepository by its electronic
> > address on flow 1.1.
> >
> > I installed Party extension and everything is OK. My users extend Person
> > class, and I did something like this in my user controller:
> >
> > $address =
> >
> >
> $this->securityContext->getAccount()->getParty()->getPrimaryElectronicAddress()->getUsage();
> > $this->view->assign('users',
> > $this->userRepository->findByPrimaryElectronicAddress($address));
> >
> > but this doesn't work.
> > Any help would be appreciated.
> >
> > Thanks in advance,
> > Sergio
> > _______________________________________________
> > FLOW3-general mailing list
> > FLOW3-general at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> >
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>


More information about the FLOW3-general mailing list