final class Column implements Stringable

Database Column Object.

Methods

__construct(string $field, string $type, bool $unsigned = false, bool $autoIncrement = false, bool $notNull = false, bool $primaryKey = false, string|null $bracket = null, string|null $default = null, string|null $extra = null)

Column constructor.

array
toArray()

Get column information array.

static Column
make(string $field, string $type, bool $unsigned = false, bool $autoIncrement = false, bool $notNull = false, bool $primaryKey = false, string|null $bracket = null, string|null $default = null, string|null $extra = null)

Create a instance.

string
fake()

Get the row string form database factory, then return the string for Seeder class.

string
migration()

Get the row string for migration file, then return the string for migration class.

string
__toString()

Class magic method to get the instance information for a Exception

Details

at line 25
__construct(string $field, string $type, bool $unsigned = false, bool $autoIncrement = false, bool $notNull = false, bool $primaryKey = false, string|null $bracket = null, string|null $default = null, string|null $extra = null)

Column constructor.

Parameters

string $field

Name of the column

string $type

Type of the column

bool $unsigned

Nullable flag

bool $autoIncrement

Nullable flag

bool $notNull

Nullable flag

bool $primaryKey

Key of the column

string|null $bracket

Length or something of the column

string|null $default

Default value

string|null $extra

Extra information of the column

at line 44
array toArray()

Get column information array.

Return Value

array

The method returns column information array

at line 72
static Column make(string $field, string $type, bool $unsigned = false, bool $autoIncrement = false, bool $notNull = false, bool $primaryKey = false, string|null $bracket = null, string|null $default = null, string|null $extra = null)

Create a instance.

Parameters

string $field

Name of the column

string $type

Type of the column

bool $unsigned

Nullable flag

bool $autoIncrement

Nullable flag

bool $notNull

Nullable flag

bool $primaryKey

Key of the column

string|null $bracket

Length or something of the column

string|null $default

Default value

string|null $extra

Extra information of the column

Return Value

Column

at line 101
string fake()

Get the row string form database factory, then return the string for Seeder class.

Return Value

string

The method returns a Seeder class row string

at line 111
string migration()

Get the row string for migration file, then return the string for migration class.

Return Value

string

The method returns a Migration class row string

at line 121
string __toString()

Class magic method to get the instance information for a Exception

Return Value

string

The method returns the instance information for a Exception