✏️ 正在编辑: EmailConfiguracao.php
路径:
/srv/systems_dir/yuppiecred/application/models/DbTable/EmailConfiguracao.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php use Doctrine\Common\Collections\ArrayCollection; use Service_Enum_TipoEmailConfiguracao as TipoEmail; class Model_DbTable_EmailConfiguracao extends Core_DbTable { /** @var string */ public const TIPO_RELATORIO = 'Recebimento Relatorio'; protected $_primary = 'id'; protected $_name = 'tb_emails_configuracao'; public function insert(array $data) { $emailWhere = "email = '" . $data['email'] . "'"; $tipoWhere = "tipo = '" . $data['tipo'] . "'"; $exist = $this->fetchRow($emailWhere . " AND " . $tipoWhere); if( $exist ){ throw new Exception("E-mail já cadastrado."); } return parent::insert($data); } /** * @return ArrayCollection */ public function findEmailsRelatorio(): ArrayCollection { $query = $this->getAdapter() ->select() ->from($this->_name) ->where('excluido <> ?', 1) ->where('tipo = ?', TipoEmail::RELATORIO) ; return new ArrayCollection($this->getAdapter()->fetchAll($query)); } /** * @return ArrayCollection */ public function findEmailsNotificacaoCampanha(): ArrayCollection { $query = $this->getAdapter() ->select() ->from($this->_name) ->where('excluido <> ?', 1) ->where('tipo = ?', \Modules\Mail\Enum\TipoEmail::NOTIFICACAO_CAMPANHA) ; return new ArrayCollection($this->getAdapter()->fetchAll($query)); } }
💾 保存文件
← 返回文件管理器