addFormFields($form, $profile, isProfile: true); } /** * @throws \DateMalformedStringException * @throws InvalidArgument * @throws InvalidLinkException * @throws \Doctrine\DBAL\Exception|\ReflectionException */ public function processForm(Profile $profile): void { $this->processUserForm($profile->getIdentity()); } protected function getEntityClass(): ?string { return $this->_em->findEntityClassByInterface(Profile::class); } /** * @param Profile $entity * @param array $values * @return void */ protected function initEntity(Entity $entity, array $values): void { if ( !isset($values['identity']['email']) || (!$identity = $this->_identityQueryFactory->create()->disableSecurityFilter()->disableAccountFilter()->byContext($this->_fancyAdmin->getContext())->byEmail($values['identity']['email'])->fetchOneOrNull()) ) { /** @var Identity $identity */ $identity = new ($this->_em->findEntityClassByInterface(Identity::class)); $identity->setContext($this->_fancyAdmin->getContext()); $this->_em->persist($identity); } $entity->setIdentity($identity); } public function isAllowedToEdit(): true { return true; } }