PHP Class Corcel\Model

Inheritance: extends Illuminate\Database\Eloquent\Model
Datei anzeigen Open project: jgrossi/corcel Class Usage Examples

Public Methods

Method Description
belongsTo ( string $related, null $foreignKey = null, null $otherKey = null, null $relation = null ) : BelongsTo Replace the original belongsTo function to forward the connection name
belongsToMany ( string $related, null $table = null, null $foreignKey = null, null $otherKey = null, null $relation = null ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Replace the original belongsToMany function to forward the connection name
getRelationValue ( string $key ) : mixed Get the relation value setting the connection name
hasMany ( string $related, null $foreignKey = null, null $localKey = null ) : Illuminate\Database\Eloquent\Relations\HasMany Replace the original hasMany function to forward the connection name
hasOne ( string $related, null $foreignKey = null, null $localKey = null ) : Illuminate\Database\Eloquent\Relations\HasOne Replace the original hasOne function to forward the connection name

Protected Methods

Method Description
setRelationConnection ( $model ) Set the connection name to model

Method Details

belongsTo() public method

Replace the original belongsTo function to forward the connection name
public belongsTo ( string $related, null $foreignKey = null, null $otherKey = null, null $relation = null ) : BelongsTo
$related string
$foreignKey null
$otherKey null
$relation null
return Illuminate\Database\Eloquent\Relations\BelongsTo

belongsToMany() public method

Replace the original belongsToMany function to forward the connection name
public belongsToMany ( string $related, null $table = null, null $foreignKey = null, null $otherKey = null, null $relation = null ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
$related string
$table null
$foreignKey null
$otherKey null
$relation null
return Illuminate\Database\Eloquent\Relations\BelongsToMany

getRelationValue() public method

Get the relation value setting the connection name
public getRelationValue ( string $key ) : mixed
$key string
return mixed

hasMany() public method

Replace the original hasMany function to forward the connection name
public hasMany ( string $related, null $foreignKey = null, null $localKey = null ) : Illuminate\Database\Eloquent\Relations\HasMany
$related string
$foreignKey null
$localKey null
return Illuminate\Database\Eloquent\Relations\HasMany

hasOne() public method

Replace the original hasOne function to forward the connection name
public hasOne ( string $related, null $foreignKey = null, null $localKey = null ) : Illuminate\Database\Eloquent\Relations\HasOne
$related string
$foreignKey null
$localKey null
return Illuminate\Database\Eloquent\Relations\HasOne

setRelationConnection() protected method

Set the connection name to model
protected setRelationConnection ( $model )
$model