UserFrosting API

Seeder

Seeder Class.

Finds all seeds class across sprinkles

Tags
author

Louis Charette

Table of Contents

$ci ContainerInterface
$scheme string
__construct() Class Constructor. mixed
getSeeds() Loop all the available sprinkles and return a list of their seeds. array
getSeed() Get a single seed info. array
getSeedClass() Return the class instance of a seed. SeedInterface
executeSeed() Execute a seed class. mixed
execute() Execute a seed based on it's name. mixed
loadSeeders() Process seeder Resource into info. array
getSeedDetails() Return an array of seed details inclusing the classname and the sprinkle name. array

Properties

$ci

protected ContainerInterface $ci

$scheme

protected string $scheme = 'seeds://'

Methods

__construct()

Class Constructor.

public __construct( $ci : ContainerInterface ) : mixed
Parameters
$ci : ContainerInterface
Return values
mixed

getSeeds()

Loop all the available sprinkles and return a list of their seeds.

public getSeeds( ) : array
Return values
array

An array of all the seed classes found for every sprinkle

getSeed()

Get a single seed info.

public getSeed( $name : string ) : array
Parameters
$name : string

The seed name

Tags
throws
Exception

If seed not found

Return values
array

The details about a seed file [name, class, sprinkle]

getSeedClass()

Return the class instance of a seed.

public getSeedClass( $name : string ) : SeedInterface
Parameters
$name : string

The seed name

Tags
throws
Exception

If class doesn't exist or is not right interface

Return values
SeedInterface

The seed class instance

execute()

Execute a seed based on it's name.

public execute( $seedName : string ) : mixed
Parameters
$seedName : string
Return values
mixed

loadSeeders()

Process seeder Resource into info.

protected loadSeeders( $seedFiles : array ) : array
Parameters
$seedFiles : array

List of seeds file

Return values
array

getSeedDetails()

Return an array of seed details inclusing the classname and the sprinkle name.

protected getSeedDetails( $file : Resource ) : array
Parameters
$file : Resource

The seed file

Return values
array

The details about a seed file [name, class, sprinkle]

Search results