Add new seeder
@param AbstractPopulator $seeder
556318
public function addSeeder(AbstractPopulator $seeder)
    {
        $seeder->setPopulator($this);
        $seeder->setDatabase($this->database);
        $seeder->setFaker($this->faker);
        $this->seeders[] = $seeder;
    }
1295971
protected function associateBelongsTo(array &$formatters, BelongsTo $relation, $seeding) {
        $relatedClass = get_class($relation->getRelated());
        $foreignKey = $relation->{$this->getBelongsToForeignKeyNameMethod()}();

        // Skips dynamic relationships.
        if (!isset($this->columns[$foreignKey])) {
            return;
        }

        $alwaysAssociate = $this->columns[$foreignKey]->getNotnull() || !$seeding;

        $formatters[$foreignKey] = function ($model, $insertedPKs) use ($relatedClass, $alwaysAssociate) {
            if (!isset($insertedPKs[$relatedClass])) {
                return null;
            }

            if ($alwaysAssociate) {
                return $this->generator->randomElement($insertedPKs[$relatedClass]);
            }

            return $this->generator->optional()->randomElement($insertedPKs[$relatedClass]);
        };
    }
938063
public function addProviders()
    {
        foreach ($this->providers as $provider) {
            $this->generator->addProvider(new $provider($this->generator));
        }
    }
1031433
public static function create(
        array $visitors = [],
        InstantiatorInterface $instantiator = null,
        AccessorInterface $accessor = null,
        MutatorInterface $mutator = null
    ) {
        $instantiator = $instantiator ?: new DoctrineInstantiator();
        $accessor = $accessor ?: new ReflectionAccessor();
        $mutator = $mutator ?: new ReflectionMutator();

        return new static(array_replace_recursive([
            Direction::SERIALIZATION => [
                Format::CSV  => new CsvSerializationVisitor($accessor),
                Format::JSON => new JsonSerializationVisitor($accessor),
                Format::XML  => new XmlSerializationVisitor($accessor),
                Format::YAML => new YamlSerializationVisitor($accessor),
            ],
            Direction::DESERIALIZATION => [
                Format::CSV  => new CsvDeserializationVisitor($instantiator, $mutator),
                Format::JSON => new JsonDeserializationVisitor($instantiator, $mutator),
                Format::XML  => new XmlDeserializationVisitor($instantiator, $mutator),
                Format::YAML => new YamlDeserializationVisitor($instantiator, $mutator),
            ],
        ], $visitors));
    }
922620
protected function initializeFileLoader(FileLoader $fileLoader = null)
    {
        if (!isset($this->fileLoader)) {
            $this->setFileLoader(($fileLoader) ? $fileLoader : new FileLoader());
        }
    }
862255
public function add($seed, $region = null)
    {
        if (!$this->layout) {
            throw new Exception(['If you use $app->add() you should first call $app->setLayout()']);
        }

        return $this->layout->add($seed, $region);
    }
298876
public function setDownloader(DownloaderInterface $downloader = null)
    {
        if (null === $downloader) {
            $downloader = $this->defaultDownloader();
        }
        $this->downloader = $downloader;
    }
731088
public static function populateValidator(Validator $validator)
	{
		if (static::$provider === null)
		{
			static::setProvider(new FromArray(true, 'validation'));
		}

		return static::$provider->populateValidator($validator);
	}
972688
public function addAccessor($accessor)
    {
        if (in_array($accessor, $this->accessorDefaults['getter'])) {
            $this->addGetter($accessor);
        } elseif (in_array($accessor, $this->accessorDefaults['setter'])) {
            $this->addSetter($accessor);
        } else {
            throw new \InvalidArgumentException(sprintf('Unexpected property accessor "%s" available accessors are [get,is,bind,set]', $accessor));
        }

    }
1096326
private function registerSeederMakeCommand()
    {
        $this->app->bindShared('command.make.package.seeder', function ($app)
        {
            return new SeederMakeCommand($app['files'], $app['packages']);
        });

        $this->commands('command.make.package.seeder');
    }
269462
public function addConfig(LoaderInterface ...$loaders): ApplicationBuilder
    {
        foreach ($loaders as $loader) {
            $this->configs[] = $loader;
        }

        return $this;
    }
489780
public function addEvent(AbstractEvent $event) {
        $this->eventHandlerFactory->getHandlerForEvent($event)->addEvent($event);
        return $this;
    }
1308500
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));
            }
        }
    }
1023503
public function addEmbedResource(AbstractResource $resource)
    {
        if (!in_array($resource, $this->embedResources)) {
            // Uses node ID as array key in order to avoid duplicates
            $this->embedResources[$resource->getResourceNode()->getId()] = $resource;
        }
    }
705815
protected function callSeeder($resource)
    {
        $tableName = str_plural($this->getModelName($resource));

        if ($this->confirm("Would you like a '$tableName' table seeder? [yes|no]"))
        {
            $this->call('generate:seed', compact('tableName'));
        }
    }
699011
public function setUploader($uploader, $info = null)
    {
        self::$xml['uploader'] = VideoItemUploaderTags::setUploader($this->validator, $uploader, $info);
    }
798338
protected function registerSeedGenerator()
	{
		$this->app['generate.seed'] = $this->app->share(function($app)
		{
			$cache = new Cache($app['files']);
			$generator = new Generators\SeedGenerator($app['files'], $cache);

			return new Commands\SeedGeneratorCommand($generator);
		});
	}