Fixing style errors.

This commit is contained in:
stickler-ci 2019-11-14 20:56:31 +00:00
parent 837c7276ab
commit b2d18a8e0c

View File

@ -264,7 +264,7 @@ class Categories extends DolibarrApi
) )
); );
} }
/** /**
* List categories of an object * List categories of an object
* *
@ -278,7 +278,7 @@ class Categories extends DolibarrApi
* @return array Array of category objects * @return array Array of category objects
* *
* @throws RestException * @throws RestException
* *
* @url GET /object/{type}/{id} * @url GET /object/{type}/{id}
*/ */
public function getListForObject($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) public function getListForObject($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
@ -287,13 +287,13 @@ class Categories extends DolibarrApi
if (!in_array($type, ['product'/*, 'member', 'customer', 'supplier', 'contact'*/])) { if (!in_array($type, ['product'/*, 'member', 'customer', 'supplier', 'contact'*/])) {
throw new RestException(401); throw new RestException(401);
} }
if($type == 'product' && ! (DolibarrApiAccess::$user->rights->produit->lire || DolibarrApiAccess::$user->rights->service->lire)) { if($type == 'product' && ! (DolibarrApiAccess::$user->rights->produit->lire || DolibarrApiAccess::$user->rights->service->lire)) {
throw new RestException(401); throw new RestException(401);
} }
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page); $categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);
if( ! count($categories)) { if( ! count($categories)) {
throw new RestException(404, 'No category found for this object'); throw new RestException(404, 'No category found for this object');
} }