PHP Class Sleimanx2\Plastic\Fillers\EloquentFiller

Inheritance: implements Sleimanx2\Plastic\Fillers\FillerInterface
Afficher le fichier Open project: sleimanx2/plastic

Méthodes publiques

Méthode Description
fill ( Model $model, PlasticResult $result ) : mixed | void Fill the results hists into Model.
fillModel ( Model $model, array $hit = [] ) : static New From Hit Builder.
loadPivotAttribute ( Model $model, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) Get the pivot attribute from a model.
newFromBuilderRecursive ( Model $model, array $attributes = [], Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : mixed Fill a model with form an elastic hit.

Méthodes protégées

Méthode Description
hydrateRecursive ( Model $model, array $items, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : Collection Create a collection of models from plain arrays recursive.
loadRelationsAttributesRecursive ( Model $model ) Get the relations attributes from a model.

Private Methods

Méthode Description
isMultiLevelArray ( array $array ) : boolean Check if an array is multi-level array like [[id], [id], [id]].

Method Details

fill() public méthode

Fill the results hists into Model.
public fill ( Model $model, PlasticResult $result ) : mixed | void
$model Illuminate\Database\Eloquent\Model
$result Sleimanx2\Plastic\PlasticResult
Résultat mixed | void

fillModel() public méthode

Variation on newFromBuilder. Instead, takes
public fillModel ( Model $model, array $hit = [] ) : static
$model Illuminate\Database\Eloquent\Model
$hit array
Résultat static

hydrateRecursive() protected méthode

Create a collection of models from plain arrays recursive.
protected hydrateRecursive ( Model $model, array $items, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : Collection
$model Illuminate\Database\Eloquent\Model
$items array
$parentRelation Illuminate\Database\Eloquent\Relations\Relation
Résultat Illuminate\Support\Collection

loadPivotAttribute() public méthode

Get the pivot attribute from a model.
public loadPivotAttribute ( Model $model, Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null )
$model Illuminate\Database\Eloquent\Model
$parentRelation Illuminate\Database\Eloquent\Relations\Relation

loadRelationsAttributesRecursive() protected méthode

Get the relations attributes from a model.
protected loadRelationsAttributesRecursive ( Model $model )
$model Illuminate\Database\Eloquent\Model

newFromBuilderRecursive() public méthode

Fill a model with form an elastic hit.
public newFromBuilderRecursive ( Model $model, array $attributes = [], Illuminate\Database\Eloquent\Relations\Relation $parentRelation = null ) : mixed
$model Illuminate\Database\Eloquent\Model
$attributes array
$parentRelation Illuminate\Database\Eloquent\Relations\Relation
Résultat mixed