trait Relationship (Voir la source)

Méthodes

string
getKey()

Get the table key

belongsTo(string $related, string $foreign_key = null, string $local_key = null)

The has one relative

belongsToMany(string $related, string $primary_key = null, string $foreign_key = null)

The belongs to many relative

hasMany(string $related, string $primary_key = null, string $foreign_key = null)

The has many relative

hasOne(string $related, string $primary_key = null, string $foreign_key = null)

The has one relative

Détails

abstract string getKey()

Get the table key

Valeur de retour

string

BelongsTo belongsTo(string $related, string $foreign_key = null, string $local_key = null)

The has one relative

Paramètres

string $related
string $foreign_key
string $local_key

Valeur de retour

BelongsTo

BelongsToMany belongsToMany(string $related, string $primary_key = null, string $foreign_key = null)

The belongs to many relative

Paramètres

string $related
string $primary_key
string $foreign_key

Valeur de retour

BelongsToMany

HasMany hasMany(string $related, string $primary_key = null, string $foreign_key = null)

The has many relative

Paramètres

string $related
string $primary_key
string $foreign_key

Valeur de retour

HasMany

HasOne hasOne(string $related, string $primary_key = null, string $foreign_key = null)

The has one relative

Paramètres

string $related
string $primary_key
string $foreign_key

Valeur de retour

HasOne