PHP Class Nwidart\Modules\Support\Migrations\SchemaParser

Inheritance: implements Illuminate\Contracts\Support\Arrayable
Afficher le fichier Open project: nwidart/laravel-modules Class Usage Examples

Protected Properties

Свойство Type Description
$customAttributes array The array of custom attributes.
$relationshipKeys array The relationship keys.
$schema string The migration schema.

Méthodes publiques

Méthode Description
__construct ( string | null $schema = null ) Create new instance.
createField ( string $column, array $attributes, $type = 'add' ) : string Create field.
down ( ) : string Render down migration fields.
getAttributes ( string $column, string $schema ) : array Get column attributes.
getColumn ( string $schema ) : string Get column name from schema.
getCustomAttribute ( string $column ) : array Get custom attributes value.
getSchemas ( ) : array Get array of schema.
hasCustomAttribute ( string $column ) : boolean Determine whether the given column is exist in customAttributes array.
parse ( string $schema ) : array Parse a string to array of formatted schema.
render ( ) : string Render the migration to formatted script.
toArray ( ) : array Convert string migration to array.
up ( ) : string Render up migration fields.

Méthodes protégées

Méthode Description
addColumn ( integer $key, string $field, string $column ) : string Format field to script.
addRelationColumn ( integer $key, string $field, string $column ) : string Add relation column.
removeColumn ( integer $key, string $field, string $column ) : string Format field to script.

Method Details

__construct() public méthode

Create new instance.
public __construct ( string | null $schema = null )
$schema string | null

addColumn() protected méthode

Format field to script.
protected addColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Résultat string

addRelationColumn() protected méthode

Add relation column.
protected addRelationColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Résultat string

createField() public méthode

Create field.
public createField ( string $column, array $attributes, $type = 'add' ) : string
$column string
$attributes array
Résultat string

down() public méthode

Render down migration fields.
public down ( ) : string
Résultat string

getAttributes() public méthode

Get column attributes.
public getAttributes ( string $column, string $schema ) : array
$column string
$schema string
Résultat array

getColumn() public méthode

Get column name from schema.
public getColumn ( string $schema ) : string
$schema string
Résultat string

getCustomAttribute() public méthode

Get custom attributes value.
public getCustomAttribute ( string $column ) : array
$column string
Résultat array

getSchemas() public méthode

Get array of schema.
public getSchemas ( ) : array
Résultat array

hasCustomAttribute() public méthode

Determine whether the given column is exist in customAttributes array.
public hasCustomAttribute ( string $column ) : boolean
$column string
Résultat boolean

parse() public méthode

Parse a string to array of formatted schema.
public parse ( string $schema ) : array
$schema string
Résultat array

removeColumn() protected méthode

Format field to script.
protected removeColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Résultat string

render() public méthode

Render the migration to formatted script.
public render ( ) : string
Résultat string

toArray() public méthode

Convert string migration to array.
public toArray ( ) : array
Résultat array

up() public méthode

Render up migration fields.
public up ( ) : string
Résultat string

Property Details

$customAttributes protected_oe property

The array of custom attributes.
protected array $customAttributes
Résultat array

$relationshipKeys protected_oe property

The relationship keys.
protected array $relationshipKeys
Résultat array

$schema protected_oe property

The migration schema.
protected string $schema
Résultat string