Esempio n. 1
0
 public function delete(PropelPDO $con = null, $definitivo = false)
 {
     if ($definitivo) {
         parent::delete();
     } else {
         $this->setFechaBorrado(date('Y-m-d H:i:s'));
         $this->save();
     }
 }
Esempio n. 2
0
 public function save(PropelPDO $con = null)
 {
     if ($this->isNew()) {
         $clave = $this->getClave();
         $this->setClave(sha1($clave));
     } else {
         $clave = $this->getClave();
         $this->setClave($clave);
         // sfContext::getInstance()->getLogger()->log("VelNot CLAVE ".$clave);
     }
     return parent::save($con);
 }
Esempio n. 3
0
 public function save(PropelPDO $con = null)
 {
     $BitacoraCambios = new BitacoraCambios();
     $BitacoraCambios->setModelo('Usuario');
     $BitacoraCambios->setIp(sfContext::getInstance()->getRequest()->getRemoteAddress());
     if ($this->isNew()) {
         $clave = $this->getClave();
         $this->setClave(sha1($clave));
         $BitacoraCambios->setDescripcion('Creacion de Usuario: ' . $this->getUsuario());
     } else {
         $clave = $this->getClave();
         $this->setClave($clave);
         $BitacoraCambios->setDescripcion('Modificacion de Usuario: ' . $this->getUsuario());
     }
     $Usuario = UsuarioQuery::create()->findOneById(sfContext::getInstance()->getUser()->getAttribute('usuario', null, 'seguridad'));
     if ($Usuario) {
         $BitacoraCambios->setCreatedBy($Usuario->getUsuario());
     }
     $BitacoraCambios->save();
     return parent::save($con);
 }
Esempio n. 4
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     UsuarioPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new UsuarioPeer();
     }
     return self::$peer;
 }
 /**
  * Encriptar la contraseña automaticamente
  * @param string $v the clear password
  */
 public function setClave($v)
 {
     $encrypted = sha1($v);
     return parent::_set('clave', $encrypted);
 }
Esempio n. 6
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }