From cfa0860d244896fe64ca5e2e29b01b210e915a0a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 21 Nov 2019 16:41:45 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/product/class/api_products.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2f3f7463b8d..04d9979cefe 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -914,7 +914,7 @@ class Products extends DolibarrApi } return $resid; } - + /** * Update attributes by id. * @@ -933,22 +933,22 @@ class Products extends DolibarrApi if(! DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); - + $result = $prodattr->fetch((int) $id); if ($result == 0) { throw new RestException(404, 'Attribute not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute"); } - + foreach($request_data as $field => $value) { if ($field == 'rowid') { continue; } $prodattr->$field = $value; } - + if ($prodattr->update(DolibarrApiAccess::$user) > 0) { $result = $prodattr->fetch((int) $id); if ($result == 0) { @@ -1190,7 +1190,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error creating new attribute value"); } - + /** * Update attribute value. * @@ -1208,22 +1208,22 @@ class Products extends DolibarrApi if(! DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $result = $objectval->fetch((int) $id); - + if ($result == 0) { throw new RestException(404, 'Attribute value not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute value"); } - + foreach($request_data as $field => $value) { if ($field == 'rowid') { continue; } $objectval->$field = $value; } - + if ($objectval->update(DolibarrApiAccess::$user) > 0) { $result = $objectval->fetch((int) $id); if ($result == 0) {