PHP Class Sleimanx2\Plastic\Mappings\Creator

Show file Open project: sleimanx2/plastic Class Usage Examples

Protected Properties

Property Type Description
$files Illuminate\Filesystem\Filesystem The filesystem instance.
$postCreate array The registered post create hooks.

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $filesystem ) MappingCreator constructor.
afterCreate ( Closure $callback ) : void Register a post migration create hook.
create ( $model, $path ) : string Create a mapping file.
getFilesystem ( ) : Illuminate\Filesystem\Filesystem Return the filesystem instance.
getStubPath ( ) : string Get the path to the stubs.

Protected Methods

Method Description
firePostCreateHooks ( ) : void Fire the registered post create hooks.
getClassName ( $model ) : string Get the class name of a migration name.
getPath ( string $model, string $path ) : string Get the full path name to the mapping.
getStub ( ) : string Get the mapping stub template.
populateStub ( string $model, string $stub ) : string Populate the place-holders in the mapping stub.

Method Details

__construct() public method

MappingCreator constructor.
public __construct ( Illuminate\Filesystem\Filesystem $filesystem )
$filesystem Illuminate\Filesystem\Filesystem

afterCreate() public method

Register a post migration create hook.
public afterCreate ( Closure $callback ) : void
$callback Closure
return void

create() public method

Create a mapping file.
public create ( $model, $path ) : string
$model
$path
return string

firePostCreateHooks() protected method

Fire the registered post create hooks.
protected firePostCreateHooks ( ) : void
return void

getClassName() protected method

Get the class name of a migration name.
protected getClassName ( $model ) : string
$model
return string

getFilesystem() public method

Return the filesystem instance.
public getFilesystem ( ) : Illuminate\Filesystem\Filesystem
return Illuminate\Filesystem\Filesystem

getPath() protected method

Get the full path name to the mapping.
protected getPath ( string $model, string $path ) : string
$model string
$path string
return string

getStub() protected method

Get the mapping stub template.
protected getStub ( ) : string
return string

getStubPath() public method

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

populateStub() protected method

Populate the place-holders in the mapping stub.
protected populateStub ( string $model, string $stub ) : string
$model string
$stub string
return string

Property Details

$files protected property

The filesystem instance.
protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$postCreate protected property

The registered post create hooks.
protected array $postCreate
return array