PHP Trait Esensi\Model\Traits\RelatingModelTrait

See also: Esensi\Model\Contracts\RelatingModelInterface
Author: Daniel LaBarge ([email protected])
Datei anzeigen Open project: esensi/model

Public Methods

Method Description
__call ( string $method, array $parameters ) : mixed Dynamically call methods.
__get ( string $key ) : mixed Dynamically retrieve attributes.
belongsTo ( string $related, string $foreignKey = null, string $otherKey = null, string $relation = null ) : BelongsTo Define an inverse one-to-one or many relationship.
getPivotAttributes ( string $name ) : array Return the relationship configurations.
getRelationship ( string $name ) : array Return the relationship configurations.
getRelationships ( ) : array Get the relationships.
hasPivotAttributes ( string $name ) : boolean Return whether the relationshpi has pivot attributes or not.
isRelationship ( string $name ) : boolean Return whether the name is a relationship or not.
morphTo ( string $name = null, string $type = null, string $id = null ) : Illuminate\Database\Eloquent\Relations\MorphTo Define an polymorphic, inverse one-to-one or many relationship.
scopeWithout ( Illuminate\Database\Query\Builder $query, mixed $relations ) Set the relationships that should not be eager loaded.

Protected Methods

Method Description
callDynamicRelationship ( string $name ) : mixed Call a dynamically resolved relationship.
callRelationship ( string $name ) : mixed Proxy call a relationship method using the configuration arguments of the relationship.
getDynamicRelationship ( string $name ) : mixed Get a dynamically resolved relationship.

Method Details

__call() public method

Dynamically call methods.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

__get() public method

Dynamically retrieve attributes.
public __get ( string $key ) : mixed
$key string
return mixed

belongsTo() public method

Define an inverse one-to-one or many relationship.
public belongsTo ( string $related, string $foreignKey = null, string $otherKey = null, string $relation = null ) : BelongsTo
$related string
$foreignKey string
$otherKey string
$relation string
return Illuminate\Database\Eloquent\Relations\BelongsTo

callDynamicRelationship() protected method

Call a dynamically resolved relationship.
protected callDynamicRelationship ( string $name ) : mixed
$name string
return mixed

callRelationship() protected method

Proxy call a relationship method using the configuration arguments of the relationship.
protected callRelationship ( string $name ) : mixed
$name string of related model
return mixed

getDynamicRelationship() protected method

Get a dynamically resolved relationship.
protected getDynamicRelationship ( string $name ) : mixed
$name string
return mixed

getPivotAttributes() public method

Return the relationship configurations.
public getPivotAttributes ( string $name ) : array
$name string of related model
return array

getRelationship() public method

Return the relationship configurations.
public getRelationship ( string $name ) : array
$name string of related model
return array

getRelationships() public method

Get the relationships.
public getRelationships ( ) : array
return array

hasPivotAttributes() public method

Return whether the relationshpi has pivot attributes or not.
public hasPivotAttributes ( string $name ) : boolean
$name string of related model
return boolean

isRelationship() public method

Return whether the name is a relationship or not.
public isRelationship ( string $name ) : boolean
$name string of related model
return boolean

morphTo() public method

Define an polymorphic, inverse one-to-one or many relationship.
public morphTo ( string $name = null, string $type = null, string $id = null ) : Illuminate\Database\Eloquent\Relations\MorphTo
$name string
$type string
$id string
return Illuminate\Database\Eloquent\Relations\MorphTo

scopeWithout() public method

Set the relationships that should not be eager loaded.
public scopeWithout ( Illuminate\Database\Query\Builder $query, mixed $relations )
$query Illuminate\Database\Query\Builder
$relations mixed