Fix phpcs

This commit is contained in:
Laurent Destailleur 2019-09-03 14:48:06 +02:00
parent 6b9d31cf0a
commit ffcea3dfd8

View File

@ -479,7 +479,7 @@ class Products extends DolibarrApi
* @param string $barcode Barcode of element * @param string $barcode Barcode of element
* @param int $includestockdata Load also information about stock (slower) * @param int $includestockdata Load also information about stock (slower)
* @return array|mixed Data without useless information * @return array|mixed Data without useless information
* *
* @url GET {id}/purchase_prices * @url GET {id}/purchase_prices
* *
* @throws 401 * @throws 401
@ -502,16 +502,16 @@ class Products extends DolibarrApi
$result = $this->product->fetch($id, $ref, $ref_ext, $barcode); $result = $this->product->fetch($id, $ref, $ref_ext, $barcode);
if(! $result ) { if(! $result ) {
throw new RestException(404, 'Product not found'); throw new RestException(404, 'Product not found');
} }
if(! DolibarrApi::_checkAccessToResource('product', $this->product->id)) { if(! DolibarrApi::_checkAccessToResource('product', $this->product->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
if ($includestockdata) { if ($includestockdata) {
$this->product->load_stock(); $this->product->load_stock();
} }
if($result) { if($result) {
$this->product = new ProductFournisseur($this->db); $this->product = new ProductFournisseur($this->db);
$this->product->fetch($id, $ref); $this->product->fetch($id, $ref);