Skip to content

sonrac/symfony-seed-command

Repository files navigation

Build Status StyleCI

Scrutinizer Build Scrutinizer Scrutinizer Code Coverage codecov Packagist Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads composer.lock

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages