✏️ 正在编辑: AutomatizacaoController.php
路径:
/srv/systems_dir/yuppiecred/application/controllers/AutomatizacaoController.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php use Modules\Core\Exception\FormException; use Modules\Automatizacao\{Form\AutomatizacaoForm, Service\AutomatizacaoService}; use Modules\Automatizacao\Form\OportunidadesNegociosForm as OportunidadesForm; class AutomatizacaoController extends Zend_Controller_Action { /** @var AutomatizacaoService */ private $service; public function init() { $this->service = new AutomatizacaoService(); parent::init(); } public function saveAction() { $request = $this->getRequest(); $dto = $this->service->save($request); if ($dto && $dto->getId()) { $this->_helper->flashMessenger(['success' => "Registro salvo com sucessos!"]); } $this->view->form = new AutomatizacaoForm($this->_request->getBaseUrl(), $dto); } public function oportunidadesNegociosAction() { $this->view->form = OportunidadesForm::filtro(); $this->view->filtros = $this->service->getAllOportunidadesNegociosFiltro(); $this->view->edit = OportunidadesForm::ACTION . '-update'; } public function oportunidadesNegociosSaveAction() { $request = $this->getRequest(); $form = new OportunidadesForm(); try { $result = $this->service->saveOportunidades($request, $form); if ($result) { $this->_helper->flashMessenger(['success' => 'Cadastro realizado com sucesso.']); $this->_helper->redirector('oportunidades-negocios'); } } catch (FormException | DomainException $exception) { $this->_helper->flashMessenger(['error' => $exception->getMessage()]); } catch (Throwable $throwable) { $this->_helper->flashMessenger(['error' => $throwable->getMessage()]); } $this->view->form = $form; } public function oportunidadesNegociosUpdateAction() { $request = $this->getRequest(); $form = new OportunidadesForm($request->getParam('id')); try { $result = $this->service->saveOportunidades($request, $form); if ($result) { $this->_helper->flashMessenger(['success' => 'Cadastro atualzado com sucesso.']); $this->_helper->redirector('oportunidades-negocios'); } } catch (FormException | DomainException $exception) { $this->_helper->flashMessenger(['error' => $exception->getMessage()]); } catch (Throwable $throwable) { $this->_helper->flashMessenger(['error' => $throwable->getMessage()]); } $this->view->form = $form; $this->render('oportunidades-negocios-save'); } }
💾 保存文件
← 返回文件管理器