public static function verifyUser($usuario, $password)
    {
        try {
            $sql = 'SELECT ' . credencialTableClass::getNameField(credencialTableClass::NOMBRE) . ' as credencial,
	' . usuarioTableClass::getNameField(usuarioTableClass::USER) . ' as usuario,
	' . usuarioTableClass::getNameField(usuarioTableClass::ID) . ' as id_usuario
    FROM ' . usuarioTableClass::getNameTable() . ' LEFT JOIN ' . usuarioCredencialTableClass::getNameTable() . ' ON ' . usuarioTableClass::getNameField(usuarioTableClass::ID) . ' = ' . usuarioCredencialTableClass::getNameField(usuarioCredencialTableClass::USUARIO_ID) . '
    LEFT JOIN ' . credencialTableClass::getNameTable() . ' ON ' . credencialTableClass::getNameField(credencialTableClass::ID) . ' = ' . usuarioCredencialTableClass::getNameField(usuarioCredencialTableClass::CREDENCIAL_ID) . '
    WHERE ' . usuarioTableClass::getNameField(usuarioTableClass::ACTIVED) . ' = :actived
    AND ' . usuarioTableClass::getNameField(usuarioTableClass::DELETED_AT) . ' IS NULL
    AND ' . credencialTableClass::getNameField(credencialTableClass::DELETED_AT) . ' IS NULL
    AND ' . usuarioTableClass::getNameField(usuarioTableClass::USER) . ' = :user
    AND ' . usuarioTableClass::getNameField(usuarioTableClass::PASSWORD) . ' = :pass';
            $params = array(':user' => $usuario, ':pass' => md5($password), ':actived' => config::getDbDriver() === 'mysql' ? 1 : 't');
            $answer = model::getInstance()->prepare($sql);
            $answer->execute($params);
            $answer = $answer->fetchAll(PDO::FETCH_OBJ);
            return count($answer) > 0 ? $answer : false;
        } catch (PDOException $exc) {
            throw $exc;
        }
    }
 public static function getUserAndPassword($ip_address, $hash)
 {
     try {
         $sql = 'SELECT ' . usuarioTableClass::getNameField(usuarioTableClass::ID) . ' AS id_usuario,
               ' . usuarioTableClass::getNameField(usuarioTableClass::USER) . ' AS usuario,
               ' . credencialTableClass::getNameField(credencialTableClass::NOMBRE) . ' AS credencial
           FROM ' . usuarioTableClass::getNameTable() . ' INNER JOIN ' . recordarMeTableClass::getNameTable() . ' ON ' . usuarioTableClass::getNameField(usuarioTableClass::ID) . ' = ' . recordarMeTableClass::getNameField(recordarMeTableClass::USUARIO_ID) . '
                INNER JOIN ' . usuarioCredencialTableClass::getNameTable() . ' ON ' . usuarioTableClass::getNameField(usuarioTableClass::ID) . ' = ' . usuarioCredencialTableClass::getNameField(usuarioCredencialTableClass::USUARIO_ID) . '
                INNER JOIN ' . credencialTableClass::getNameTable() . ' ON ' . credencialTableClass::getNameField(credencialTableClass::ID) . ' = ' . usuarioCredencialTableClass::getNameField(usuarioCredencialTableClass::CREDENCIAL_ID) . '
           WHERE ' . recordarMeBaseTableClass::getNameField(recordarMeTableClass::IP_ADDRESS) . ' = :ip_address
           AND ' . recordarMeBaseTableClass::getNameField(recordarMeTableClass::HASH_COOKIE) . ' = :hash
           AND ' . usuarioBaseTableClass::getNameField(usuarioBaseTableClass::DELETED_AT) . ' IS NULL
           AND ' . usuarioBaseTableClass::getNameField(usuarioBaseTableClass::ACTIVED) . ' = :actived
           AND ' . credencialTableClass::getNameField(credencialTableClass::DELETED_AT) . ' IS NULL';
         $params = array(':ip_address' => $ip_address, ':hash' => $hash, ':actived' => config::getDbDriver() === 'mysql' ? 1 : 't');
         $answer = model::getInstance()->prepare($sql);
         $answer->execute($params);
         $answer = $answer->fetchAll(PDO::FETCH_OBJ);
         return count($answer) > 0 ? $answer : false;
     } catch (PDOException $exc) {
         throw $exc;
     }
 }
config::setRowGrid(10);
config::setDbHost('localhost');
config::setDbDriver('pgsql');
// mysql
config::setDbName('granja_porcicola_final');
config::setDbPort(5432);
// 3306
config::setDbUser('postgres');
config::setDbPassword('sena');
// Esto solo es necesario en caso de necesitar un socket para la DB
config::setDbUnixSocket(null);
///tmp/mysql.sock
if (config::getDbUnixSocket() !== null) {
    config::setDbDsn(config::getDbDriver() . ':unix_socket=' . config::getDbUnixSocket() . ';dbname=' . config::getDbName());
} else {
    config::setDbDsn(config::getDbDriver() . ':host=' . config::getDbHost() . ';port=' . config::getDbPort() . ';dbname=' . config::getDbName());
}
config::setPathAbsolute('/var/www/html/proyecto_porcicola/');
config::setUrlBase('http://www.granjaporcicola.com/');
config::setScope('prod');
// dev
if (session::getInstance()->hasDefaultCulture() === false) {
    config::setDefaultCulture('es');
} else {
    config::setDefaultCulture(session::getInstance()->getDefaultCulture());
}
config::setIndexFile('index.php');
config::setFormatTimestamp('Y-m-d H:i:s');
config::setHeaderJson('Content-Type: application/json; charset=utf-8');
config::setHeaderXml('Content-Type: application/xml; charset=utf-8');
config::setHeaderHtml('Content-Type: text/html; charset=utf-8');