From bf0ebb51d77a061ae970a1303c6b1a6f614ef86b Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 16 May 2010 22:24:26 +0200 Subject: [PATCH] Flatten PFC_NChildren arguments. Signed-off-by: Florent Bruneau --- classes/plfilter.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/plfilter.php b/classes/plfilter.php index c478732..09aea0a 100644 --- a/classes/plfilter.php +++ b/classes/plfilter.php @@ -246,10 +246,14 @@ abstract class PFC_NChildren implements PlFilterCondition public function __construct() { - $children = func_get_args(); - foreach ($children as &$child) { - if (!is_null($child) && ($child instanceof PlFilterCondition)) { - $this->addChild($child); + $this->addChildren(pl_flatten(func_get_args())); + } + + public function addChildren(array $conds) + { + foreach ($conds as &$cond) { + if (!is_null($cond) && ($cond instanceof PlFilterCondition)) { + $this->addChild($cond); } } } -- 2.1.4