PHP Class Devise\Support\DeviseSeeder

Inheritance: extends Illuminate\Database\Seeder
Afficher le fichier Open project: devisephp/cms

Méthodes publiques

Méthode Description
findOrCreateRow ( string $tableName, array $uniqueKeys, array $data, $timestamps = true ) : StdObject We are creating a new page when it does not exist already.
run ( ) : void Run the database seeds.

Méthodes protégées

Méthode Description
callOnlyOnce ( [type] $seederClass ) : [type] This gives us the ability to call the seeds only once. We will keep up with what classes have ran in the database and that way we know which ones to call and which ones not to call.
findOrCreateRows ( string $tableName, array | string $uniqueKeys, $rows, boolean $timestamps = true ) : array Iterate over all the rows and insert them one by one checking for existing before
findRow ( string $tableName, array $uniqueKeys, array $data ) : StdObject Search for the row with these unique keys

Method Details

callOnlyOnce() protected méthode

This gives us the ability to call the seeds only once. We will keep up with what classes have ran in the database and that way we know which ones to call and which ones not to call.
protected callOnlyOnce ( [type] $seederClass ) : [type]
$seederClass [type]
Résultat [type]

findOrCreateRow() public méthode

We use the route name as it should be unique. If an row already exists with the same route name we just ignore the insert. We use similiar logic for new page versions. If a page does not have a page version then it will not be available at it's url because we don't show pages unless there is an active page version
public findOrCreateRow ( string $tableName, array $uniqueKeys, array $data, $timestamps = true ) : StdObject
$tableName string
$uniqueKeys array
$data array
Résultat StdObject

findOrCreateRows() protected méthode

Iterate over all the rows and insert them one by one checking for existing before
protected findOrCreateRows ( string $tableName, array | string $uniqueKeys, $rows, boolean $timestamps = true ) : array
$tableName string
$uniqueKeys array | string
$timestamps boolean
Résultat array

findRow() protected méthode

Search for the row with these unique keys
protected findRow ( string $tableName, array $uniqueKeys, array $data ) : StdObject
$tableName string
$uniqueKeys array
$data array
Résultat StdObject

run() public méthode

Run the database seeds.
public run ( ) : void
Résultat void