PHP Класс Flugg\Responder\Transformer

Автор: Alexander Tømmerås ([email protected])
Наследование: extends League\Fractal\TransformerAbstract
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$relations array A list of all available relations.

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Описание методов

allRelationsAllowed() публичный Метод

Check if the transformer has whitelisted all relations.
public allRelationsAllowed ( ) : boolean
Результат boolean

callIncludeMethod() защищенный Метод

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
Результат League\Fractal\Resource\ResourceInterface | boolean

getRelations() публичный Метод

Get relations set on the transformer.
public getRelations ( ) : array
Результат array

includePivot() защищенный Метод

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
Результат League\Fractal\Resource\ResourceInterface | boolean

setRelations() публичный Метод

Set relations on the transformer.
public setRelations ( array | string $relations ) : self
$relations array | string
Результат self

Описание свойств

$relations защищенное свойство

A list of all available relations.
protected array $relations
Результат array