SurCategoriesSeed.php 1.07 KB
<?php
use Migrations\AbstractSeed;

/**
 * SurCategories seed.
 */
class SurCategoriesSeed extends AbstractSeed
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeds is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     *
     * @return void
     */
    public function run()
    {
        $data = [
            [
                'id' => '1',
                'nom' => 'Electronique',
            ],
            [
                'id' => '2',
                'nom' => 'Informatique',
            ],
            [
                'id' => '3',
                'nom' => 'Instrumentation',
            ],
            [
                'id' => '4',
                'nom' => 'Logistique',
            ],
            [
                'id' => '5',
                'nom' => 'Mecanique',
            ],
            [
                'id' => '6',
                'nom' => 'Optique',
            ],
        ];

        $table = $this->table('sur_categories');
        $table->insert($data)->save();
    }
}