Fixing style errors.

This commit is contained in:
stickler-ci 2019-11-21 14:50:47 +00:00
parent d6ba06e271
commit 4f747e2eb8

View File

@ -849,7 +849,7 @@ class Products extends DolibarrApi
return $prodattr; return $prodattr;
} }
/** /**
* Get attributes by ref. * Get attributes by ref.
* *
@ -866,23 +866,23 @@ class Products extends DolibarrApi
if(! DolibarrApiAccess::$user->rights->produit->lire) { if(! DolibarrApiAccess::$user->rights->produit->lire) {
throw new RestException(401); throw new RestException(401);
} }
$sql = "SELECT rowid, ref, label, rang FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '". trim($ref) ."' AND entity IN (".getEntity('product').")"; $sql = "SELECT rowid, ref, label, rang FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '". trim($ref) ."' AND entity IN (".getEntity('product').")";
$query = $this->db->query($sql); $query = $this->db->query($sql);
if (!$this->db->num_rows($query)) { if (!$this->db->num_rows($query)) {
throw new RestException(404); throw new RestException(404);
} }
$result = $this->db->fetch_object($query); $result = $this->db->fetch_object($query);
$attr = []; $attr = [];
$attr['id'] = $result->rowid; $attr['id'] = $result->rowid;
$attr['ref'] = $result->ref; $attr['ref'] = $result->ref;
$attr['label'] = $result->label; $attr['label'] = $result->label;
$attr['rang'] = $result->rang; $attr['rang'] = $result->rang;
return $attr; return $attr;
} }