getEntityClass() && !$this->disableAccountInput) { $refClass = new \ReflectionClass($this->getEntityClass()); if ($refClass->hasProperty('account')) { $accountyQuery = $this->_accountQueryFactory->create(); if ($this->securityUser->getIdentity()->getSelectedAccount()) { $accountyQuery->byIdOrParentId($this->securityUser->getIdentity()->getSelectedAccount()); } if ($accountyQuery->count() > 1) { $pairs = []; foreach ($accountyQuery->orderBy(['parent' => 'ASC', 'name' => 'ASC'])->fetch() as $_account) { if ($_account->getParent()) { $pairs[$_account->getId()] = '-- ' . $_account->getName(); } else { $pairs[$_account->getId()] = $_account->getName(); } } $form->addSelect('account', 'fcadmin.forms.user.labels.account', $pairs) ->setPrompt('---') ->setRequired(); } } } } protected function createComponentForm(): Form { $form = new Form(); $form->setTranslator($this->_translator); $form->setEntityManager($this->_em); $form->setRenderer(new BootstrapFormRenderer($form)); if ($this->csrfProtection) { $form->addProtection('fcadmin.forms.errors.csrf'); } return $form; } public function getSidePanelSize(): SidePanelSize { return SidePanelSize::Medium; } public function getRedirect($entity = null): ?array { return null; } public function getSnippetsToRedraw(): array { return []; } public static function getDefaultTemplateFile(): string { return __DIR__ . '/BaseForm.latte'; } }