final class ForeignKey implements Stringable (View source)

Database ForeignKey Object.

Methods

__construct(string $name, string $table, string $column, string $referenced_table, string $referenced_column)

ForeignKey constructor.

array
toArray()

Get column information array.

static ForeignKey
make(string $name, string $table, string $column, string $referenced_table, string $referenced_column)

Create a instance.

string
belongsTo()

Get the belongsTo relation from this model to another.

string
hasMany()

Get the hasMany relation from another model to this.

string
__toString()

Class magic method to get the instance information for a Exception

Details

__construct(string $name, string $table, string $column, string $referenced_table, string $referenced_column)

ForeignKey constructor.

Parameters

string $name

Name of the key

string $table

Table name

string $column

Column name

string $referenced_table

Referenced table name

string $referenced_column

Referenced column name

array toArray()

Get column information array.

Return Value

array

The method returns column information array

static ForeignKey make(string $name, string $table, string $column, string $referenced_table, string $referenced_column)

Create a instance.

Parameters

string $name

Name of the key

string $table

Table name

string $column

Column name

string $referenced_table

Referenced table name

string $referenced_column

Referenced column name

Return Value

ForeignKey

string belongsTo()

Get the belongsTo relation from this model to another.

Return Value

string

The method returns a relation function string

string hasMany()

Get the hasMany relation from another model to this.

Return Value

string

The method returns a relation function string

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