PHP Class Orangehill\Iseed\Iseed

Afficher le fichier Open project: orangehill/iseed Class Usage Examples

Protected Properties

Свойство Type Description
$databaseName string Name of the database upon which the seed will be executed.

Méthodes publiques

Méthode Description
__construct ( Illuminate\Filesystem\Filesystem $filesystem = null )
cleanSection ( ) : boolean Cleans the iSeed section
generateClassName ( string $table ) : string Generates a seed class name (also used as a filename)
generateSeed ( string $table, string $database = null, integer $max, string $prerunEvent = null, $postrunEvent = null ) : boolean Generates a seed file.
getData ( string $table, $max ) : Array Get the Data
getPath ( string $name, string $path ) : string Create the full path name to the seed file.
getSeedPath ( ) : string Get a seed folder path
getStubPath ( ) : string Get the path to the stub file.
hasTable ( string $table ) : boolean Checks if a database table exists
populateStub ( string $class, string $stub, string $table, string $data, integer $chunkSize = null, string $prerunEvent = null, $postrunEvent = null ) : string Populate the place-holders in the seed stub.
repackSeedData ( array | object $data ) : array Repacks data read from the database
updateDatabaseSeederRunMethod ( string $className ) : boolean Updates the DatabaseSeeder file's run method (kudoz to: https://github.com/JeffreyWay/Laravel-4-Generators)

Méthodes protégées

Méthode Description
prettifyArray ( array $array ) : string Prettify a var_export of an array

Private Methods

Méthode Description
addIndent ( string &$content, integer $numberOfIndents = 1 ) Adds indentation to the passed content reference.
addNewLines ( string &$content, integer $numberOfLines = 1 ) Adds new lines to the passed content variable reference.

Method Details

__construct() public méthode

public __construct ( Illuminate\Filesystem\Filesystem $filesystem = null )
$filesystem Illuminate\Filesystem\Filesystem

cleanSection() public méthode

Cleans the iSeed section
public cleanSection ( ) : boolean
Résultat boolean

generateClassName() public méthode

Generates a seed class name (also used as a filename)
public generateClassName ( string $table ) : string
$table string
Résultat string

generateSeed() public méthode

Generates a seed file.
public generateSeed ( string $table, string $database = null, integer $max, string $prerunEvent = null, $postrunEvent = null ) : boolean
$table string
$database string
$max integer
$prerunEvent string
Résultat boolean

getData() public méthode

Get the Data
public getData ( string $table, $max ) : Array
$table string
Résultat Array

getPath() public méthode

Create the full path name to the seed file.
public getPath ( string $name, string $path ) : string
$name string
$path string
Résultat string

getSeedPath() public méthode

Get a seed folder path
public getSeedPath ( ) : string
Résultat string

getStubPath() public méthode

Get the path to the stub file.
public getStubPath ( ) : string
Résultat string

hasTable() public méthode

Checks if a database table exists
public hasTable ( string $table ) : boolean
$table string
Résultat boolean

populateStub() public méthode

Populate the place-holders in the seed stub.
public populateStub ( string $class, string $stub, string $table, string $data, integer $chunkSize = null, string $prerunEvent = null, $postrunEvent = null ) : string
$class string
$stub string
$table string
$data string
$chunkSize integer
$prerunEvent string
Résultat string

prettifyArray() protected méthode

Prettify a var_export of an array
protected prettifyArray ( array $array ) : string
$array array
Résultat string

repackSeedData() public méthode

Repacks data read from the database
public repackSeedData ( array | object $data ) : array
$data array | object
Résultat array

updateDatabaseSeederRunMethod() public méthode

Updates the DatabaseSeeder file's run method (kudoz to: https://github.com/JeffreyWay/Laravel-4-Generators)
public updateDatabaseSeederRunMethod ( string $className ) : boolean
$className string
Résultat boolean

Property Details

$databaseName protected_oe property

Name of the database upon which the seed will be executed.
protected string $databaseName
Résultat string