Documentation

Seeder
in package

Class Seeder

Table of Contents

$config  : Database
An instance of the main Database configuration
$db  : BaseConnection
Database Connection instance
$DBGroup  : string
The name of the database group to use.
$forge  : Forge
Database Forge instance.
$seedPath  : string
Where we can find the Seed files.
$silent  : bool
If true, will not display CLI messages.
$faker  : Generator|null
Faker Generator instance.
__construct()  : mixed
Seeder constructor.
call()  : void
Loads the specified seeder and runs it.
faker()  : Generator|null
Gets the Faker Generator instance.
run()  : mixed
Run the database seeds. This is where the magic happens.
setPath()  : $this
Sets the location of the directory that seed files can be located in.
setSilent()  : $this
Sets the silent treatment.

Properties

$config

An instance of the main Database configuration

protected Database $config

$DBGroup

The name of the database group to use.

protected string $DBGroup

$seedPath

Where we can find the Seed files.

protected string $seedPath

$silent

If true, will not display CLI messages.

protected bool $silent = false

Methods

call()

Loads the specified seeder and runs it.

public call(string $class) : void
Parameters
$class : string
Tags
throws
InvalidArgumentException
Return values
void

run()

Run the database seeds. This is where the magic happens.

public run() : mixed

Child classes must implement this method and take care of inserting their data here.

Tags
codeCoverageIgnore
Return values
mixed

setPath()

Sets the location of the directory that seed files can be located in.

public setPath(string $path) : $this
Parameters
$path : string
Return values
$this

setSilent()

Sets the silent treatment.

public setSilent(bool $silent) : $this
Parameters
$silent : bool
Return values
$this

Search results