[TYPO3-mvc] update an existing fe_user without editAction
Kevin Ulrich Moschallski
km at 3digit.de
Sat May 22 16:18:57 CEST 2010
Hi,
sorry for the strange title of the posting, but i didn't find any better way to describe it in short.
I have an controller where i create fe_users. This works fine.
My problem is, i want to check if an fe_user already exist by mapping it with the email address. I do this with a repository call:
$this->userRepository->findOneByEmail($newUser->getEmail())
This works fine.
How could i update this user?
I tried
$this->userRepository->replace($existingUser, $newUser);
but then i get an exception:
The given row must contain a value for "uid".
00795: $dataMap->getTableName(),
00796: $row
00797: );
00798: if ($this->extbaseSettings['persistence']['updateReferenceIndex'] === '1') {
00799: $this->referenceIndex->updateRefIndexTable($dataMap->getTableName(), $row['uid']);
I can't figure out what's the problem here. When i print_r the $exisitingUser object it has a value for uid.
My question is also if there is a better way to update the user instead of replace it. I don't know how i could use $this->userRepository->update because i don't know how i could manipulate the object with the changed data.
Thanks for help in advance.
Regards,
Kevin Moschallski
More information about the TYPO3-project-typo3v4mvc
mailing list