/**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      SesionLog $value A SesionLog object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(SesionLog $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getIdLog();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Exemplo n.º 2
0
 /**
  * Añade una visita a la sesion actual
  *
  */
 public function guardarVisita($mensaje = '')
 {
     global $PHP_SELF;
     $visita = new SesionLog();
     $visita->setMensaje($mensaje);
     $visita->setFecha(Date::format(FMT_DATETIMEMYSQL));
     $visita->setUrl($PHP_SELF);
     $visita->setSesion($this);
     $visita->autoCargarParams();
     if (isset($_SERVER['SSL_CLIENT_CERT'])) {
         $visita->setPublicKey($_SERVER['SSL_CLIENT_CERT']);
     }
     $get_params = $visita->getParamsarray();
     if (strtolower($visita->getModulo()) == "usuarios" && strtolower($visita->getAccion()) == "delete") {
         $afirmar = $visita->getModulo() . " - " . $visita->getAccion() . " - " . $_REQUEST['id_usuario'];
         $visita->setFirma(UsuarioPeer::getFirma($afirmar));
     } elseif (strtolower($visita->getModulo()) == "usuarios" && strtolower($visita->getAccion()) == "edit" && isset($get_params['id_usuario']) && $get_params['id_usuario'] == "") {
         $afirmar = $visita->getModulo() . " - " . $visita->getAccion() . " - " . $_REQUEST['usuario']['nombre'];
         $visita->setFirma(UsuarioPeer::getFirma($afirmar));
     }
     $visita->save();
 }