✏️ 正在编辑: GerentePromotora.php
路径:
/srv/systems_dir/yuppiecred-bkp/application/models/GerentePromotora.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Model_GerentePromotora extends Model_PessoaFisica { private $_empresaId; private $_apelido; private $_banco; private $_agencia; private $_conta; private $_tipoConta; //Corrente / Poupança private $_titular; private $_cpfTitular; private $_obs; public function getEmpresaId() { return $this->_empresaId; } public function setEmpresaId($empresaId) { $this->_empresaId = $empresaId; } public function getApelido() { return $this->_apelido; } public function setApelido($apelido) { $this->_apelido = $apelido; } public function getBanco() { return $this->_banco; } public function setBanco($banco) { $this->_banco = $banco; } public function getAgencia() { return $this->_agencia; } public function setAgencia($agencia) { $this->_agencia = $agencia; } public function getConta() { return $this->_conta; } public function setConta($conta) { $this->_conta = $conta; } public function getTipoConta() { return $this->_tipoConta; } public function setTipoConta($tipoConta) { $this->_tipoConta = $tipoConta; } public function getTitular() { return $this->_titular; } public function setTitular($titular) { $this->_titular = $titular; } public function getCpfTitular() { return $this->_cpfTitular; } public function setCpfTitular($cpfTitular) { $this->_cpfTitular = $cpfTitular; } public function getObs() { return $this->_obs; } public function setObs($obs) { $this->_obs = $obs; } 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_GerentePromotora(); $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 $data; } /** * Insere ou altera o registro passado por parâmetro * @param Model_GerentePromotora $gerente */ public function salvar(Model_GerentePromotora $gerente) { $dbtable = new Model_DbTable_GerentePromotora(); if( $gerente->getId() > 0 ){ $dbtable->update($gerente->_toArray(), "id = " . $gerente->getId()); return $gerente->getId(); } else { $dbtable->insert($gerente->_toArray()); return $dbtable->getAdapter()->lastInsertId(); } } /** * 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_GerentePromotora(); return $dbtable->delete("id = " . $id); } return null; } /** * Retorna uma lista * @param string $where * @param string $order * @param int $count * @param int $offset * @return array */ public function listar($where = null, $order = null, $count = null, $offset = null) { $dbtable = new Model_DbTable_GerentePromotora(); return $dbtable->fetchAll($where, $order, $count, $offset); } /** * 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_GerentePromotora(); return $dbtable->fetchRow("id = " . $id); } }
💾 保存文件
← 返回文件管理器