PHP Class Flugg\Responder\Transformer

Author: Alexander Tømmerås ([email protected])
Inheritance: extends League\Fractal\TransformerAbstract
Afficher le fichier Open project: flugger/laravel-responder Class Usage Examples

Protected Properties

Свойство Type Description
$relations array A list of all available relations.

Méthodes publiques

Méthode Description
allRelationsAllowed ( ) : boolean Check if the transformer has whitelisted all relations.
getRelations ( ) : array Get relations set on the transformer.
setRelations ( array | string $relations ) : self Set relations on the transformer.

Méthodes protégées

Méthode Description
callIncludeMethod ( League\Fractal\Scope $scope, string $includeName, mixed $data ) : League\Fractal\Resource\ResourceInterface | boolean Call method for retrieving a relation. This method overrides Fractal's own [callIncludeMethod] method to load relations directly from your models.
includePivot ( Illuminate\Database\Eloquent\Relations\Pivot $pivot ) : League\Fractal\Resource\ResourceInterface | boolean Include pivot table data to the response.

Method Details

allRelationsAllowed() public méthode

Check if the transformer has whitelisted all relations.
public allRelationsAllowed ( ) : boolean
Résultat boolean

callIncludeMethod() protected méthode

Call method for retrieving a relation. This method overrides Fractal's own [callIncludeMethod] method to load relations directly from your models.
protected callIncludeMethod ( League\Fractal\Scope $scope, string $includeName, mixed $data ) : League\Fractal\Resource\ResourceInterface | boolean
$scope League\Fractal\Scope
$includeName string
$data mixed
Résultat League\Fractal\Resource\ResourceInterface | boolean

getRelations() public méthode

Get relations set on the transformer.
public getRelations ( ) : array
Résultat array

includePivot() protected méthode

Include pivot table data to the response.
protected includePivot ( Illuminate\Database\Eloquent\Relations\Pivot $pivot ) : League\Fractal\Resource\ResourceInterface | boolean
$pivot Illuminate\Database\Eloquent\Relations\Pivot
Résultat League\Fractal\Resource\ResourceInterface | boolean

setRelations() public méthode

Set relations on the transformer.
public setRelations ( array | string $relations ) : self
$relations array | string
Résultat self

Property Details

$relations protected_oe property

A list of all available relations.
protected array $relations
Résultat array