src/Phinx/Migration/Manager.php
public function seed($environment, $seed = null)
    {
        $seeds = $this->getSeeds();

        if ($seed === null) {
            // run all seeders
            foreach ($seeds as $seeder) {
                if (array_key_exists($seeder->getName(), $seeds)) {
                    $this->executeSeed($environment, $seeder);
                }
            }
        } else {
            // run only one seeder
            if (array_key_exists($seed, $seeds)) {
                $this->executeSeed($environment, $seeds[$seed]);
            } else {
                throw new \InvalidArgumentException(sprintf('The seed class "%s" does not exist', $seed));
            }
        }
    }
public function seed($environment, $seed = null)
    {
        $seeds = $this->getSeeds();

        if ($seed === null) {
            // run all seeders
            foreach ($seeds as $seeder) {
                if (array_key_exists($seeder->getName(), $seeds)) {
                    $this->executeSeed($environment, $seeder);
                }
            }
        } else {
            // run only one seeder
            if (array_key_exists($seed, $seeds)) {
                $this->executeSeed($environment, $seeds[$seed]);
            } else {
                throw new \InvalidArgumentException(sprintf('The seed class "%s" does not exist', $seed));
            }
        }
    }
public function seed ( $ environment , $ seed = null ) { $ seeds = $ this -> getSeeds ( ) ; if ( $ seed === null ) { // run all seeders foreach ( $ seeds as $ seeder ) { if ( array_key_exists ( $ seeder -> getName ( ) , $ seeds ) ) { $ this -> executeSeed ( $ environment , $ seeder ) ; } } } else { // run only one seeder if ( array_key_exists ( $ seed , $ seeds ) ) { $ this -> executeSeed ( $ environment , $ seeds [ $ seed ] ) ; } else { throw new \ InvalidArgumentException ( sprintf ( 'The seed class "%s" does not exist' , $ seed ) ) ; } } }
Run database seeders against an environment.

@param string $environment Environment
@param string $seed Seeder
@return void
Run database seeders against an environment .