protected function startup() { parent::startup(); if (!$this->type) { $importers = $this->importerManager->getImporters(); if (count($importers)) { $this->type = key($this->importerManager->getImporters()); } else { $this->flashMessage($this->translator->translate('No importer found.'), 'info'); } } }
public function startup() { parent::startup(); if (!$this->user->identity instanceof UserEntity) { $this->flashMessage($this->translator->translate('Please log in as regular user'), 'warning'); return; } if (!$this->account) { $accounts = $this->getAccounts(); if (!count($accounts)) { $this->flashMessage($this->translator->translate('No accounts found'), 'warning'); } else { $this->account = $accounts[0]->id; } } }