✏️ 正在编辑: ContratoPortabilidade.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/models/ContratoPortabilidade.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_ContratoPortabilidade { protected $_id; protected $_contratoId; protected $_dataHoraEnvio; protected $_usuarioEnvio; protected $_valorLiberado; protected $_saldoBanco; protected $_valorParcela; protected $_prazo; protected $_respostaCorretor; protected $_comentarioCorretor; protected $_usuarioCorretor; protected $_dataHoraRespostaCorretor; protected $_respostaAdm; protected $_comentarioAdm; protected $_usuarioAdm; protected $_dataHoraRespostaAdm; 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 getDataHoraEnvio(){ return $this->_dataHoraEnvio ; } public function setDataHoraEnvio($dataHoraEnvio){ $this->_dataHoraEnvio = $dataHoraEnvio; } public function getUsuarioEnvio(){ return $this->_usuarioEnvio; } public function setUsuarioEnvio($usuarioEnvio){ $this->_usuario_envio = $usuarioEnvio; } public function getValorLiberado(){ return $this->_valorLiberado; } public function setValorLiberado($valorLiberado){ $this->_valorLiberado = $valorLiberado; } public function getSaldoBanco(){ return $this->_saldoBanco; } public function setSaldoBanco($saldoBanco){ $this->_saldoBanco = $saldoBanco; } public function geValorParcela(){ return $this->_valorParcela; } public function seValorParcela($valorParcela ){ $this->_valorParcela = $valorParcela; } public function getPrazo(){ return $this->_prazo; } public function setPrazo($prazo){ $this->_prazo = $prazo; } public function getRespostaCorretor(){ return $this->_respostaCorretor; } public function setRespostaCorretor($respostaCorretor){ $this->_respostaCorretor = $respostaCorretor; } public function getComentarioCorretor(){ return $this->_comentarioCorretor; } public function setComentarioCorretor($comentarioCorretor){ $this->_comentarioCorretor = $comentarioCorretor; } public function getUsuarioCorretor(){ return $this->_usuarioCorretor; } public function setUsuarioCorretor($usuarioCorretor){ $this->_usuarioCorretor = $usuarioCorretor; } public function getDataHoraRespostaCorretor(){ return $this->_dataHoraRespostaCorretor; } public function setDataHoraRespostaCorretor($dataHoraRespostaCorretor){ $this->_dataHoraRespostaCorretor = $dataHoraRespostaCorretor; } public function getRespostaAdm(){ return $this->_respostaAdm ; } public function setRespostaAdm($respostaAdm){ $this->_respostaAdm = $respostaAdm; } public function getComentarioAdm(){ return $this->_comentarioAdm; } public function setComentarioAdm($comentarioAdm){ $this->_comentarioAdm = $comentarioAdm; } public function getUsuarioAdm(){ return $this->_usuarioAdm; } public function setUsuarioAdm($usuarioAdm){ $this->_usuarioAdm = $usuarioAdm; } public function getDataHoraRespostaAdm(){ return $this->_dataHoraRespostaAdm; } public function setDataHoraRespostaAdm($dataHoraRespostaAdm){ $this->_dataHoraRespostaAdm = $dataHoraRespostaAdm; } 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_ContratoPortabilidade(); $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_ContratoPortabilidade(); 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_ContratoPortabilidade(); $select = $dbtable->getAdapter()->select() ->from(array('contratos_portabilidade' => 'tb_contratos_portabilidade'), array('*')) ->where("contratos_portabilidade.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('contratos_portabilidade.id DESC'); return $dbtable->getAdapter()->fetchAll($select); } /** * Retorna um fetchRow do item passado por parâmetro * @param int $id * @return Zend_Db_Table_Row_Abstract | null */ public function exibir($id) { $dbtable = new Model_DbTable_ContratoAnexo(); return $dbtable->fetchRow("id = " . $id); } /** * Exclui o registro passado por parâmetro * @param int $id * @return int The number of rows deleted */ public function excluir($id) { if( $id > 0 ){ $dbtable = new Model_DbTable_ContratoAnexo(); return $dbtable->delete("id = {$id}"); } return null; } }
💾 保存文件
← 返回文件管理器