- Added function isEmptyString to fhc_helper

- Added function isEmptyArray to fhc_helper
- Adapted the code in application/* to use as much as possible this two new functions
- Removed the php function empty almost everywhere
This commit is contained in:
Paolo
2018-06-27 15:06:04 +02:00
parent d04b0450da
commit 25e66bf9dd
23 changed files with 214 additions and 200 deletions
+4 -4
View File
@@ -484,9 +484,9 @@ class DB_Model extends FHC_Model
$tmpTable = trim($table);
// Check parameters
if (empty($tmpTable)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
if (isEmptyString($tmpTable)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
if (!empty($alias))
if (!isEmptyString($alias))
{
$tmpTable .= ' AS '.$alias;
}
@@ -586,7 +586,7 @@ class DB_Model extends FHC_Model
$result = array();
// String that represents the pgsql array, better if not empty
if (!empty($string))
if (!isEmptyString($string))
{
// Magic convertion
preg_match_all(
@@ -742,7 +742,7 @@ class DB_Model extends FHC_Model
$result = null;
// If the query is empty don't lose time
if (!empty($query))
if (!isEmptyString($query))
{
// If there are parameters to bind to the query
if (is_array($parametersArray) && count($parametersArray) > 0)