Download the PHP package soyuka/seed-bundle without Composer
On this page you can find all versions of the php package soyuka/seed-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download soyuka/seed-bundle
More information about soyuka/seed-bundle
Files in soyuka/seed-bundle
Package seed-bundle
Short Description Seed helper through symfony commands
License MIT
Informations about the package seed-bundle
Symfony/Doctrine Seed Bundle
/!\ Starting 01/01/18 I'll not actively maintain this project anymore. I'll merge PR's if any but I'm not using this anymore /!\
Maintained fork: https://github.com/evotodi/seed-bundle
Why
I needed something to load seed data that needed to stay in database. The only symfony bundle that could be used for this is the DoctrineFixturesBundle. Those are fixtures, and should be used for testing only. Data included with this are removed/purged when the command is launched. Here, I want the data to be persistent.
You can use it as a fixture bundle too by unloading
data, but it is not it's main purpose.
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