/** * Workaround for groupconcat 'bug': when the groupconcat is based on a left join, the resulting array can * contain 1 (empty) element while you would expect is has 0 elements. * This function checks for this special case, and ensures that $array is empty */ public static function fixGroupConcatArray(&$array) { if (!is_array($array)) { return; } if (count($array) != 1) { return; } Arrays::reduceNulls($array[0]); if (is_null($array[0])) { $array = array(); } }