public static function saveFights(Collection $groups, $numGroup = 1)
    {
        $competitor1 = $competitor2 = null;
        $order = 1;

        foreach ($groups as $group) {
            $fighters = $group->getFightersWithBye();

            $fighter1 = $fighters->get(0);
            $fighter2 = $fighters->get(1);
            $fighter3 = $fighters->get(2);

            switch ($numGroup) {
                case 1:
                    $competitor1 = $fighter1;
                    $competitor2 = $fighter2;
                    break;
                case 2:
                    $competitor1 = $fighter2;
                    $competitor2 = $fighter3;
                    break;
                case 3:
                    $competitor1 = $fighter3;
                    $competitor2 = $fighter1;
                    break;
            }
            $order = self::saveFight($group, $competitor1, $competitor2, $order);
        }
    }
public static function saveFights(Collection $groups, $numGroup = 1)
    {
        $competitor1 = $competitor2 = null;
        $order = 1;

        foreach ($groups as $group) {
            $fighters = $group->getFightersWithBye();

            $fighter1 = $fighters->get(0);
            $fighter2 = $fighters->get(1);
            $fighter3 = $fighters->get(2);

            switch ($numGroup) {
                case 1:
                    $competitor1 = $fighter1;
                    $competitor2 = $fighter2;
                    break;
                case 2:
                    $competitor1 = $fighter2;
                    $competitor2 = $fighter3;
                    break;
                case 3:
                    $competitor1 = $fighter3;
                    $competitor2 = $fighter1;
                    break;
            }
            $order = self::saveFight($group, $competitor1, $competitor2, $order);
        }
    }
public static function saveFights ( Collection $ groups , $ numGroup = 1 ) { $ competitor1 = $ competitor2 = null ; $ order = 1 ; foreach ( $ groups as $ group ) { $ fighters = $ group -> getFightersWithBye ( ) ; $ fighter1 = $ fighters -> get ( 0 ) ; $ fighter2 = $ fighters -> get ( 1 ) ; $ fighter3 = $ fighters -> get ( 2 ) ; switch ( $ numGroup ) { case 1 : $ competitor1 = $ fighter1 ; $ competitor2 = $ fighter2 ; break ; case 2 : $ competitor1 = $ fighter2 ; $ competitor2 = $ fighter3 ; break ; case 3 : $ competitor1 = $ fighter3 ; $ competitor2 = $ fighter1 ; break ; } $ order = self :: saveFight ( $ group , $ competitor1 , $ competitor2 , $ order ) ; } }
Save all fights.

@param Collection $groups
@param int $numGroup
Save all fights .