PHP Класс Nwidart\Modules\Support\Migrations\SchemaParser

Наследование: implements Illuminate\Contracts\Support\Arrayable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$customAttributes array The array of custom attributes.
$relationshipKeys array The relationship keys.
$schema string The migration schema.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный метод

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

addColumn() защищенный метод

Format field to script.
protected addColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Результат string

addRelationColumn() защищенный метод

Add relation column.
protected addRelationColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Результат string

createField() публичный метод

Create field.
public createField ( string $column, array $attributes, $type = 'add' ) : string
$column string
$attributes array
Результат string

down() публичный метод

Render down migration fields.
public down ( ) : string
Результат string

getAttributes() публичный метод

Get column attributes.
public getAttributes ( string $column, string $schema ) : array
$column string
$schema string
Результат array

getColumn() публичный метод

Get column name from schema.
public getColumn ( string $schema ) : string
$schema string
Результат string

getCustomAttribute() публичный метод

Get custom attributes value.
public getCustomAttribute ( string $column ) : array
$column string
Результат array

getSchemas() публичный метод

Get array of schema.
public getSchemas ( ) : array
Результат array

hasCustomAttribute() публичный метод

Determine whether the given column is exist in customAttributes array.
public hasCustomAttribute ( string $column ) : boolean
$column string
Результат boolean

parse() публичный метод

Parse a string to array of formatted schema.
public parse ( string $schema ) : array
$schema string
Результат array

removeColumn() защищенный метод

Format field to script.
protected removeColumn ( integer $key, string $field, string $column ) : string
$key integer
$field string
$column string
Результат string

render() публичный метод

Render the migration to formatted script.
public render ( ) : string
Результат string

toArray() публичный метод

Convert string migration to array.
public toArray ( ) : array
Результат array

up() публичный метод

Render up migration fields.
public up ( ) : string
Результат string

Описание свойств

$customAttributes защищенное свойство

The array of custom attributes.
protected array $customAttributes
Результат array

$relationshipKeys защищенное свойство

The relationship keys.
protected array $relationshipKeys
Результат array

$schema защищенное свойство

The migration schema.
protected string $schema
Результат string