Open X-Tender opened 4 years ago
Hi. Can you explain what you're trying to solve? Do you need the contact data in the controller or a view?
Yes, I achieved it currently via a extended FrontUser Model whre I add a custom field with the foreign table tx_contacts_domain_model_contact
so now I can do:
$user = $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($user->getContact()->getAddresses());
I thought this would be already included in the extension. Or how would you get the assigned contact from a FrontendUser?
I ran into an another problem.
I create a new Contact
in my controller and now I would like to assign a fe_user
to the contact.
In the typo3 BE its not a problem, there's the Dropdown but there is no setUser
method in the Contact
model.
Is it possible without building a sql and set the uid
of the fe_user
column manualy?
So thats how I make this currently happen
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_contacts_domain_model_contact');
$queryBuilder
->update('tx_contacts_domain_model_contact')
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($newContact->getUid()))
)
->set('fe_user', $user->getUid())
->execute();
Hi,
When I create a
Person
I can assign it to afe_user
. But how do I get thePerson
from thefe_user
? I hoped to find an additional option in thefe_user
wehre I can assign aPerson
so when I get the currently logged infe_user
I can also access thePerson
data.