Update categorie.class.php
This commit is contained in:
parent
fc58d92db4
commit
8f8f7ecf5d
@ -2011,27 +2011,24 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Count all categories
|
||||
*
|
||||
* @return int Number of categories, -1 on error
|
||||
*/
|
||||
public function count_all_categories()
|
||||
public function countNbOfCategories()
|
||||
{
|
||||
dol_syslog(get_class($this)."::count_all_categories", LOG_DEBUG);
|
||||
$sql = "SELECT COUNT(rowid) FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql .= " WHERE entity IN (".getEntity('category').")";
|
||||
$sql = "SELECT COUNT(rowid) FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql .= " WHERE entity IN (".getEntity('category').")";
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
$res = $this->db->query($sql);
|
||||
if ($res) {
|
||||
$obj = $this->db->fetch_object($res);
|
||||
return $obj->count;
|
||||
}
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
return $obj->count;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user