forked from Wavyzz/dolibarr
Clean code of not used method
This commit is contained in:
@@ -281,14 +281,17 @@ class Validate
|
||||
}
|
||||
|
||||
foreach ($value_arr as $val) {
|
||||
$sql = "SELECT ".$col." FROM ".$this->db->prefix().$table." WHERE ".$col." = '".$this->db->escape($val)."'"; // nore quick than count(*) to check existing of a row
|
||||
$resql = $this->db->getRow($sql);
|
||||
$sql = "SELECT ".$col." FROM ".$this->db->prefix().$table." WHERE ".$col." = '".$this->db->escape($val)."' LIMIT 1"; // more quick than count(*) to check existing of a row
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
continue;
|
||||
} else {
|
||||
$this->error = $this->outputLang->trans('RequireValidExistingElement');
|
||||
return false;
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// If something was wrong
|
||||
$this->error = $this->outputLang->trans('RequireValidExistingElement');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user