[TYPO3-english] Re: Re: how to: getting usernames from database based on uid
Calgacus map Brude
calgach at gmail.com
Thu Nov 7 22:07:50 CET 2013
for instance I tried this in my showAction:
$objectManger = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
// get repository
$repository = $objectManger->get('Tx_Extbase_Domain_Repository_FrontendUserRepository ');
// $newObject = new Tx_Extbase_Domain_Model_FrontendUser;
$newObject = $repository->findByUid($coupon->getCreator()); //this is the uid of whoever was loggin in
print_r($newObject);
echo $newObject->getUsername(); die;
but when that code runs I get:
Oops, an error occured!
"Tx_Extbase_Domain_Repository_FrontendUserRepository " is not a valid cache entry identifier.
More information about the TYPO3-english
mailing list