Backend\Behaviors\RelationController\HasPivotMode

Overview

HasPivotMode contains logic for managing pivot records


Protected Properties

protected Backend\Classes\WidgetBase $pivotWidget

pivotWidget for relations with pivot data

protected Model $pivotModel

pivotModel is a reference to the model used for pivot form

protected string $pivotTitle

pivotTitle used for the pivot popup

protected int $foreignId

foreignId of a selected pivot record


Public Methods

public onRelationManageAddPivot()

public onRelationManageAddPivot(): void

onRelationManageAddPivot adds multiple items using a single pivot form.

public onRelationManagePivotCreate()

public onRelationManagePivotCreate(): void

public onRelationManagePivotForm()

public onRelationManagePivotForm(): void

public onRelationManagePivotUpdate()

public onRelationManagePivotUpdate(): void

Protected Methods

protected evalPivotTitle()

protected evalPivotTitle(): string 

evalPivotTitle determines the pivot mode popup title

protected getPivotDataForAttach()

protected getPivotDataForAttach($saveData): array 

getPivotDataForAttach returns either a list of IDs to sync, or an associative array with sync keys and pivot attributes as values.

This method only exists to send the pivot attributes to the model.relation.attach event. The attributes are set and saved a second time via the regular life cycle. Eloquent should not send it to SQL twice if the attributes are an exact match.

protected makePivotFormWidget()

protected makePivotFormWidget(): void

makePivotFormWidget return a form widget based on pivot configuration