[TYPO3-mvc] catch the uid within the create Action of a controller
S.Korth
s.korth at dms-arts.com
Fri May 21 16:21:10 CEST 2010
Mario Beiser schrieb:
> Hi there,
>
> just trying to figure out, if it is possible to catch the Uid of a
> record created in the following way:
>
> public function createAction(Tx_Test_Domain_Model_FrontendUser $user) {
> ...
> $this->userRepository->add($user);
> print_r($user->getUid());
> ...
> }
>
> So the goal is to have the UID of the actual created record within the
> CREATE action. When I print out the user object, the uid isn't listed in
> the public vars. Unfortunatelly I have to call the getUid-method after
> adding, because before I didn't do this, there is no uid :-)
> So am I correct when saying that there is no supporting of getUid-method
> in the create-Action?
>
> Thanks a lot in advance.
> Mario
>
>
>
Hey Mario,
i think if you create an object you don't have an uid until you add it
to the Database. The Database sets the uid. I don't think that your
Object Storage (Object) gets this information until you sent a new
query. But don't realy know.
Sascha
More information about the TYPO3-project-typo3v4mvc
mailing list