From: Florent Bruneau Date: Sun, 16 May 2010 20:24:26 +0000 (+0200) Subject: Flatten PFC_NChildren arguments. X-Git-Tag: core/1.1.0~19 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=bf0ebb51d77a061ae970a1303c6b1a6f614ef86b;p=platal.git Flatten PFC_NChildren arguments. Signed-off-by: Florent Bruneau --- 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); } } }