src/Database/Migration/Manager.php
private function orderSeedsByDependencies(array $seeds)
    {
        $orderedSeeds = [];
        foreach ($seeds as $seed) {
            $key = \get_class($seed);
            $dependencies = $this->getSeedDependenciesInstances($seed);
            if (!empty($dependencies)) {
                $orderedSeeds[$key] = $seed;
                $orderedSeeds = \array_merge($this->orderSeedsByDependencies($dependencies), $orderedSeeds);
            } else {
                $orderedSeeds[$key] = $seed;
            }
        }

        return $orderedSeeds;
    }
private function orderSeedsByDependencies(array $seeds)
    {
        $orderedSeeds = [];
        foreach ($seeds as $seed) {
            $key = \get_class($seed);
            $dependencies = $this->getSeedDependenciesInstances($seed);
            if (!empty($dependencies)) {
                $orderedSeeds[$key] = $seed;
                $orderedSeeds = \array_merge($this->orderSeedsByDependencies($dependencies), $orderedSeeds);
            } else {
                $orderedSeeds[$key] = $seed;
            }
        }

        return $orderedSeeds;
    }
private function orderSeedsByDependencies ( array $ seeds ) { $ orderedSeeds = [ ] ; foreach ( $ seeds as $ seed ) { $ key = \ get_class ( $ seed ) ; $ dependencies = $ this -> getSeedDependenciesInstances ( $ seed ) ; if ( ! empty ( $ dependencies ) ) { $ orderedSeeds [ $ key ] = $ seed ; $ orderedSeeds = \ array_merge ( $ this -> orderSeedsByDependencies ( $ dependencies ) , $ orderedSeeds ) ; } else { $ orderedSeeds [ $ key ] = $ seed ; } } return $ orderedSeeds ; }
Order seeds by dependencies

@param AbstractSeed[] $seeds Seeds

@return AbstractSeed[]
Order seeds by dependencies