55 lines
1.2 KiB
PHP
Executable File
55 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
use Phinx\Seed\AbstractSeed;
|
|
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
|
/**
|
|
* textbook Seeder
|
|
*
|
|
* @copyright 2019 Manaknightdigital Inc.
|
|
* @link https://manaknightdigital.com
|
|
* @license Proprietary Software licensing
|
|
* @author Ryan Wong
|
|
*/
|
|
class textbookSeeder extends AbstractSeed
|
|
{
|
|
/**
|
|
* Run Method.
|
|
*
|
|
* Write your database seeder using this method.
|
|
*
|
|
* More information on writing seeders is available here:
|
|
* http://docs.phinx.org/en/latest/seeding.html
|
|
*/
|
|
public function run()
|
|
{
|
|
$data = [
|
|
[
|
|
'name' => 'Head First Java',
|
|
'isbn' => 'ISBN_1234567',
|
|
'status' => 1,
|
|
'created_at' => date('Y-m-j'),
|
|
'updated_at' => date('Y-m-j H:i:s'),
|
|
],
|
|
[
|
|
'name' => 'Oxford Practice Grammar',
|
|
'isbn' => 'ISBN_4569821',
|
|
'status' => 1,
|
|
'created_at' => date('Y-m-j'),
|
|
'updated_at' => date('Y-m-j H:i:s'),
|
|
],
|
|
[
|
|
'name' => 'Algorithms',
|
|
'isbn' => 'ISBN_9876545',
|
|
'status' => 1,
|
|
'created_at' => date('Y-m-j'),
|
|
'updated_at' => date('Y-m-j H:i:s'),
|
|
],
|
|
|
|
];
|
|
$model = $this->table('textbook');
|
|
$model->truncate();
|
|
$model->insert($data)->save();
|
|
}
|
|
}
|