Skip to content

Commit

Permalink
Configure seed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Aug 23, 2019
1 parent 48af7a7 commit f7caaf7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion config/Seeds/UsersSeed.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
<?php

use Cake\ORM\TableRegistry;
use Cake\Log\LogTrait;
use Phinx\Seed\AbstractSeed;

class UsersSeed extends AbstractSeed
{
use LogTrait;

public $records = [
public $record = [
'id' => 1,
'role_id' => 3,
'username' => 'seed',
'name' => 'Seed User',
'email' => '[email protected]',
'status' => false,
'timezone' => 'UTC',
];

public function run()
{
$Users = TableRegistry::get('Croogo/Users.Users');
$entity = $Users->newEntity($this->record);
$result = $Users->save($entity);
}

}

0 comments on commit f7caaf7

Please sign in to comment.