sonrac / symfony-seed-command
Symfony simple seed command
Installs: 12 002
Dependents: 1
Suggesters: 1
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.2
- ext-json: *
- doctrine/dbal: >=2.2.0
- symfony/console: >=4.3
Requires (Dev)
README
Install
composer require sonrac/symfony-seed-command
Introduction
The package is designed to fill the database with data bypassing migrations.
Usages for silex or symfony
Add to console application command sonrac\SeedCommand
, as example, for silex:
$app->add(new sonrac\SimpleSeed\SeedCommand(null, $app->get('db')));
Create seed:
Seed class must be implement sonrac\SimpleSeed\SeedInterface
Predefined seed classes
sonrac\SimpleSeed\SimpleSeed
Simple seed for data insert. Define getTable
for table name and getData
for get data.
Insert would be run automatically
sonrac\SimpleSeed\SimpleSeedWithCheckExists
Seed with check exists inserted data before insert.
Define getTable
for table name and getData
for get data. Also, define getWhereForRow
which is where filter for select data
before insert
Insert would be run automatically