예제 #1
0
 public function fetch($id)
 {
     $account = $this->emailServers->findOutgoing($id);
     if (!$account) {
         return null;
     }
     $account['id'] = $id;
     return new MailOutgoingEntity($account);
 }
예제 #2
0
 public function updateAction()
 {
     $id = $this->params('id');
     $server = $this->emailServers->findOutgoing($id);
     if (!$server) {
         return $this->notFoundAction();
     }
     $this->serverForm->setData($server);
     if ($this->getRequest()->isPost()) {
         $this->serverForm->setData($this->getRequest()->getPost());
         if ($this->serverForm->isValid()) {
             $data = $this->serverForm->getData();
             $this->emailServers->persistOutgoingFromArray($data, $id);
             return $this->redirect()->toRoute('admin/system/email/outgoing');
         }
     }
     return new ViewModel(['serverForm' => $this->serverForm, 'serverId' => $id, 'server' => $server]);
 }