From 42599eae640e0c7efabeae81c6cd4ae1f9f8c895 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 4 Apr 2022 17:49:41 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03838=20-=20Improve=20PHPDoc=20of=20\DBOb?= =?UTF-8?q?jectSearch::AddCondition()=20as=20it=20cannot=20have=20multiple?= =?UTF-8?q?=20condition=20on=20the=20same=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobjectsearch.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/dbobjectsearch.class.php b/core/dbobjectsearch.class.php index 8be53e24b..4fdf9c506 100644 --- a/core/dbobjectsearch.class.php +++ b/core/dbobjectsearch.class.php @@ -413,6 +413,10 @@ class DBObjectSearch extends DBSearch } /** + * Important: If you need to add a condition on the same $sFilterCode several times with different $value values; do not use this method as the previous $value occurences will be replaced by the last. Instead use: + * * {@see \DBObjectSearch::AddConditionExpression()} in loops to add conditions one by one + * * {@see \DBObjectSearch::AddConditionForInOperatorUsingParam()} for IN/NOT IN queries with lots of params at once + * * @param string $sFilterCode * @param mixed $value * @param string $sOpCode operator to use : 'IN', 'NOT IN', 'Contains',' Begins with', 'Finishes with', ... @@ -423,8 +427,6 @@ class DBObjectSearch extends DBSearch * @param bool $bParseSearchString * * @throws \CoreException - * - * @see AddConditionForInOperatorUsingParam for IN/NOT IN queries with lots of params */ public function AddCondition($sFilterCode, $value, $sOpCode = null, $bParseSearchString = false) {