Esempio n. 1
0
 public function fetch($id)
 {
     $incomingAccount = $this->emailServers->findIncoming($id);
     if (!$incomingAccount) {
         return null;
     }
     $incomingAccount['id'] = $id;
     return new MailIncomingEntity($incomingAccount);
 }
Esempio n. 2
0
 public function updateAction()
 {
     $id = $this->params('id');
     $account = $this->emailServers->findIncoming($id);
     if (!$account) {
         return $this->notFoundAction();
     }
     $this->accountForm->setData($account);
     if ($this->getRequest()->isPost()) {
         $this->accountForm->setData($this->getRequest()->getPost());
         if ($this->accountForm->isValid()) {
             $data = $this->accountForm->getData();
             $this->emailServers->persistIncomingFromArray($data, $id);
             return $this->redirect()->toRoute('admin/system/email/incoming');
         }
     }
     return new ViewModel(['accountForm' => $this->accountForm, 'accountId' => $id, 'account' => $account]);
 }