Qual: Moved duplicate method to base method

This commit is contained in:
Raphaël Doursenaud 2014-04-23 12:15:13 +02:00
parent 16ede7c52c
commit 98120862f7
5 changed files with 16 additions and 72 deletions

View File

@ -174,6 +174,22 @@ abstract class DoliDB implements Database
}
}
/**
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (empty($limit)) return "";
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
* Return version of database server into an array
*

View File

@ -466,24 +466,6 @@ class DoliDBMssql extends DoliDB
if (is_resource($resultset)) mssql_free_result($resultset);
}
/**
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (empty($limit)) return "";
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
* Escape a string to insert data
*

View File

@ -365,24 +365,6 @@ class DoliDBMysql extends DoliDB
if (is_resource($resultset)) mysql_free_result($resultset);
}
/**
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (empty($limit)) return "";
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
* Escape a string to insert data
*

View File

@ -376,24 +376,6 @@ class DoliDBMysqli extends DoliDB
if (is_object($resultset)) mysqli_free_result($resultset);
}
/**
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (empty($limit)) return "";
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
* Escape a string to insert data
*

View File

@ -510,24 +510,6 @@ class DoliDBSqlite extends DoliDB
if (is_object($resultset)) $resultset->closeCursor();
}
/**
* Define limits and offset of request
*
* @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit)
* @param int $offset Numero of line from where starting fetch
* @return string String with SQL syntax to add a limit and offset
*/
function plimit($limit=0,$offset=0)
{
global $conf;
if (empty($limit)) return "";
if ($limit < 0) $limit=$conf->liste_limit;
if ($offset > 0) return " LIMIT $offset,$limit ";
else return " LIMIT $limit ";
}
/**
* Escape a string to insert data
*