PHP Class Orangehill\Iseed\Iseed

Mostra file Open project: orangehill/iseed Class Usage Examples

Protected Properties

Property Type Description
$databaseName string Name of the database upon which the seed will be executed.

Public Methods

Method 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)

Protected Methods

Method Description
prettifyArray ( array $array ) : string Prettify a var_export of an array

Private Methods

Method 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 method

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

cleanSection() public method

Cleans the iSeed section
public cleanSection ( ) : boolean
return boolean

generateClassName() public method

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

generateSeed() public method

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
return boolean

getData() public method

Get the Data
public getData ( string $table, $max ) : Array
$table string
return Array

getPath() public method

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

getSeedPath() public method

Get a seed folder path
public getSeedPath ( ) : string
return string

getStubPath() public method

Get the path to the stub file.
public getStubPath ( ) : string
return string

hasTable() public method

Checks if a database table exists
public hasTable ( string $table ) : boolean
$table string
return boolean

populateStub() public method

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
return string

prettifyArray() protected method

Prettify a var_export of an array
protected prettifyArray ( array $array ) : string
$array array
return string

repackSeedData() public method

Repacks data read from the database
public repackSeedData ( array | object $data ) : array
$data array | object
return array

updateDatabaseSeederRunMethod() public method

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

Property Details

$databaseName protected_oe property

Name of the database upon which the seed will be executed.
protected string $databaseName
return string