✏️ 正在编辑: EsteiraAntiFraudeHistorico.php
路径:
/srv/systems_dir/yuppiecred/application/models/EsteiraAntiFraudeHistorico.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_EsteiraAntiFraudeHistorico { protected $_id; protected $_contratoId; protected $_nomeCliente; protected $_cpfCliente; protected $_numeroProtocolo; protected $_dataCadastro; protected $_excluido; public function getId(){ return $this->_id; } public function setId($id){ $this->_id = $id; } public function getContratoId(){ return $this->_contratoId; } public function setContratoId($contratoId){ $this->_contratoId = $contratoId; } public function getNomeCliente() { return $this->_nomeCliente; } public function setNomeCliente($nomeCliente) { $this->_nomeCliente = $nomeCliente; } public function getCpfCliente() { return $this->_cpfCliente; } public function setCpfCliente($cpfCliente) { $this->_cpfCliente = $cpfCliente; } public function getNumeroProtocolo() { return $this->_numeroProtocolo; } public function setNumeroProtocolo($numeroProtocolo) { $this->_numeroProtocolo = $numeroProtocolo; } public function getDataCadastro() { return $this->_dataCadastro; } public function setDataCadastro($dataCadastro) { $this->_dataCadastro = $dataCadastro; } public function __construct($options = null) { if( is_array($options) ){ $this->setOptions($options); } } public function setOptions(array $options) { $methods = get_class_methods($this); foreach ( $options as $key => $value ) { $explode = explode('_', $key); $methodName = ''; foreach ( $explode as $v ) { $methodName .= ucfirst($v); } $key = $methodName != '' ? $methodName : $key; $method = 'set' . ucfirst($key); if( in_array($method, $methods) ){ $this->$method($value); } } return $this; } public function _toArray() { $dbtable = new Model_DbTable_EsteiraAntiFraudeHistorico(); $info = $dbtable->info(); $methods = get_class_methods($this); $data = array(); foreach ( $info['cols'] as $key ) { $col = $key; $explode = explode('_', $key); $methodName = ''; foreach ( $explode as $v ) { $methodName .= ucfirst($v); } $key = $methodName != '' ? $methodName : $key; $method = 'get' . ucfirst($key); if( in_array($method, $methods) ){ $data[$col] = $this->$method(); } } return array_filter($data); } /** * Insere ou altera o registro passado por parâmetro * @param Model_ContratoAnexo $contratoAnexo */ public function salvar() { $dbtable = new Model_DbTable_EsteiraAntiFraudeHistorico(); if( $this->getId() > 0 ){ $dbtable->update($this->_toArray(), "id = {$this->getId()}"); return $this->getId(); } else { return $dbtable->insert($this->_toArray()); } } /** * Retorna uma lista de anexos * @param array $where * @param string $order * @return array */ public function listar($where = null, $order = null) { $dbtable = new Model_DbTable_EsteiraAntiFraudeHistorico(); $select = $dbtable->getAdapter()->select() ->from(['esteira_anti_fraude_historico' => 'tb_esteira_anti_fraude_historico'], ['*']) ->joinLeft([ 'usuarios_fraude' => 'tb_usuarios' ], 'esteira_anti_fraude_historico.usuario_fraude = usuarios_fraude.id', [ 'usuario_fraude_nome' => 'nome' ]) ->where("esteira_anti_fraude_historico.excluido <> 1"); if ($where) { if (is_array($where)) { foreach ($where as $cond => $value) { if (is_numeric($cond)) { $select->where($value); } else { $select->where($cond, $value); } } } else { $select->where($where); } } $select->order('esteira_anti_fraude_historico.id DESC'); return $dbtable->getAdapter()->fetchAll($select); } }
💾 保存文件
← 返回文件管理器