当前位置: 首页>>代码示例>>PHP>>正文


PHP Usuarios::setCpf方法代码示例

本文整理汇总了PHP中Usuarios::setCpf方法的典型用法代码示例。如果您正苦于以下问题:PHP Usuarios::setCpf方法的具体用法?PHP Usuarios::setCpf怎么用?PHP Usuarios::setCpf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Usuarios的用法示例。


在下文中一共展示了Usuarios::setCpf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setCpf

 /**
  * {@inheritDoc}
  */
 public function setCpf($cpf)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCpf', array($cpf));
     return parent::setCpf($cpf);
 }
开发者ID:umbernardo,项目名称:banco_projetos,代码行数:8,代码来源:__CG__Usuarios.php

示例2: editarAction

 public function editarAction()
 {
     $tp = new LoginTipo();
     $ut = new Util();
     $us = new Usuarios();
     $tiposLogin = $tp->getAllLoginTipo();
     $request = $this->getRequest();
     $id = $request->getParam('id');
     $usuario = $us->getUserByLoginId($id);
     if (!$usuario) {
         $this->_helper->redirector('listar', 'usuarios');
     }
     if ($request->isPost()) {
         $erro = false;
         $msg = '';
         $nascimento = empty($request->getPost('Nascimento')) ? NULL : $ut->dateToSql($request->getPost('Nascimento'));
         $now = $ut->nowDateSql();
         $rg = $ut->limpaDados($request->getPost('Rg'));
         $cpf = $ut->limpaDados($request->getPost('Cpf'));
         $telefone = $ut->limpaDados($request->getPost('Telefone'));
         $celular = $ut->limpaDados($request->getPost('Celular'));
         $us->setNome($request->getPost('Nome'));
         $us->setSobrenome($request->getPost('Sobrenome'));
         $us->setEmail($request->getPost('Email'));
         $us->setLoginId($id);
         $us->setRg($rg);
         $us->setCpf($cpf);
         $us->setNascimento($nascimento);
         $us->setTelefone($telefone);
         $us->setCelular($celular);
         $us->setSexo($request->getPost('Sexo'));
         $us->setCadastradoEm($now);
         $data = array('nome' => $us->getNome(), 'sobrenome' => $us->getSobrenome(), 'email' => $us->getEmail(), 'login_id' => $us->getLoginId(), 'rg' => $us->getRg(), 'cpf' => $us->getCpf(), 'nascimento' => $us->getNascimento(), 'telefone' => $us->getTelefone(), 'celular' => $us->getCelular(), 'sexo' => $us->getSexo());
         $us->saveUser($data, $id);
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $adapter->setDestination(APPLICATION_PATH . '/../data/temp');
         $upload = new Zend_File_Transfer();
         $files = $upload->getFileInfo();
         if ($files['Avatar']['tmp_name']) {
             if (!file_exists(ROOT_DIR . DS . 'painel' . DS . 'images' . DS . 'usuario' . DS . $id)) {
                 mkdir(ROOT_DIR . DS . 'painel' . DS . 'images' . DS . 'usuario' . DS . $id, 0777, true);
             }
             foreach ($files as $file => $info) {
                 if ($upload->isUploaded($file)) {
                     //$extension = substr($info['name'], strrpos($info['name'], '.') + 1);
                     $filename = 'avatar.jpg';
                     $adapter->addFilter('Rename', array('target' => APPLICATION_PATH . '/../data/temp/' . $filename, 'overwrite' => true));
                     $adapter->receive($info['name']);
                     if (!$adapter->receive()) {
                         $messages = $adapter->getMessages();
                         echo implode("\n", $messages);
                         exit;
                     }
                     //setFileName::Url2
                     $us->setAvatar($filename);
                     $imanee = new Imanee\Imanee(APPLICATION_PATH . '/../data/temp/' . $filename);
                     //resized
                     $imanee->resize(300, 300, false)->write(ROOT_DIR . DS . 'painel' . DS . 'images' . DS . 'usuario' . DS . $id . DS . $filename, 80);
                     //full
                     //$imanee->resize(1024, 768)
                     //        ->write(ROOT_DIR . DS . 'site' . DS . 'images' . DS . 'galeria' . DS . $album_id . DS . 'f_' . $filename, 80);
                     unlink(APPLICATION_PATH . '/../data/temp/' . $filename);
                 }
             }
         }
         if ($erro) {
             $msg = 'Ocorreu um erro, tente novamente';
             $this->view->msg = $msg;
         } else {
             $this->_helper->redirector('listar', 'usuarios');
         }
     }
     $this->view->usuario = $usuario;
     $this->view->tipos = $tiposLogin;
     $this->view->util = $ut;
     $this->render();
 }
开发者ID:agenciaaeh,项目名称:kahina,代码行数:77,代码来源:UsuariosController.php


注:本文中的Usuarios::setCpf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。