Download the PHP package intechventures/seed-bundle without Composer
On this page you can find all versions of the php package intechventures/seed-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intechventures/seed-bundle
More information about intechventures/seed-bundle
Files in intechventures/seed-bundle
Package seed-bundle
Short Description Seed helper through symfony commands
License MIT
Informations about the package seed-bundle
Symfony/Doctrine Seed Bundle
Description
Loads seed data similar to Laravel seeders, ideal for creating test data that needs to persist in a database.
The only symfony bundle that could be used for this is the DoctrineFixturesBundle but these are fixtures and should be used with tests only as the data will not persist in the database.
This package could be used as a fixture bundle too by unloading
data.
Installation
composer require intechventures/seed-bundle
Configuration
Building a Seed
The Seed
class is a Command
and :
- Must extend
Soyuka\SeedBundle\Command\Seed
- Must have a class name that ends by
Seed
- Must call
setSeedName
in the configure method
Loading a seed
The SeedBundle gives you two default commands and one for each seed you made. With the previous example, I'd have:
The global seed:load
and seed:unload
allow you to run multiple seeds in one command. You can of course skip seeds app/console seed:load --skip Town
but also name the one you want app/console seed:load Country
. For more informations, please use app/console seed:load --help
.
Seed order
Every seed has a getOrder
method that is used to sort them. The default value is 0
.
Licence
All versions of seed-bundle with dependencies
symfony/framework-bundle Version ^3.0
symfony/console Version ^3.0
symfony/finder Version ^3.0
doctrine/doctrine-bundle Version ~1.6
doctrine/orm Version ~2.5