From 5940fb13911e3f7e2501e03295c9c81f405cf4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 5 Nov 2020 23:03:44 +0100 Subject: [PATCH] doxygen --- .../societe/class/api_thirdparties.class.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 509c1419a00..2faccd3d106 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Pierre Chéné * Copyright (C) 2019 Cedric Ancelin + * Copyright (C) 2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +69,7 @@ class Thirdparties extends DolibarrApi * Return an array with thirdparty informations * * @param int $id Id of third party to load - * @return array|mixed data without useless information + * @return Object Cleaned Societe object * * @throws RestException */ @@ -83,7 +84,7 @@ class Thirdparties extends DolibarrApi * Return an array with thirdparty informations * * @param string $email Email of third party to load - * @return array|mixed data without useless information + * @return Object Cleaned Societe object * * @url GET email/{email} * @@ -100,7 +101,7 @@ class Thirdparties extends DolibarrApi * Return an array with thirdparty informations * * @param string $barcode Barcode of third party to load - * @return array|mixed data without useless information + * @return Object Cleaned Societe object * * @url GET barcode/{barcode} * @@ -154,9 +155,9 @@ class Thirdparties extends DolibarrApi $sql .= " AND t.fk_stcomm = st.id"; if ($mode == 1) $sql .= " AND t.client IN (1, 3)"; - if ($mode == 2) $sql .= " AND t.client IN (2, 3)"; - if ($mode == 3) $sql .= " AND t.client IN (0)"; - if ($mode == 4) $sql .= " AND t.fournisseur IN (1)"; + elseif ($mode == 2) $sql .= " AND t.client IN (2, 3)"; + elseif ($mode == 3) $sql .= " AND t.client IN (0)"; + elseif ($mode == 4) $sql .= " AND t.fournisseur IN (1)"; // Select thirdparties of given category if ($category > 0) { @@ -188,8 +189,7 @@ class Thirdparties extends DolibarrApi $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { - if ($page < 0) - { + if ($page < 0) { $page = 0; } $offset = $limit * $page; @@ -249,7 +249,7 @@ class Thirdparties extends DolibarrApi * * @param int $id Id of thirdparty to update * @param array $request_data Datas - * @return int + * @return Object|boolean */ public function put($id, $request_data = null) { @@ -271,8 +271,9 @@ class Thirdparties extends DolibarrApi $this->company->$field = $value; } - if ($this->company->update($id, DolibarrApiAccess::$user, 1, '', '', 'update')) + if ($this->company->update($id, DolibarrApiAccess::$user, 1, '', '', 'update')) { return $this->get($id); + } return false; } @@ -1840,7 +1841,7 @@ class Thirdparties extends DolibarrApi * @param string $idprof6 Prof id 6 of third party (Warning, this can return several records) * @param string $email Email of third party (Warning, this can return several records) * @param string $ref_alias Name_alias of third party (Warning, this can return several records) - * @return array|mixed data without useless information + * @return Object cleaned Societe object * * @throws RestException */