Backend\Behaviors\RelationController\HasViewMode

Overview

HasViewMode contains logic for viewing related records


Protected Properties

protected ListWidget|null $viewListWidget

viewListWidget used for viewing as a list

protected FormWidget|null $viewFormWidget

viewFormWidget used for viewing as a form

protected Backend\Widgets\Filter $viewFilterWidget

protected Model $viewModel

viewModel is a reference to the model used for viewing (form only)

protected string $viewMode

viewMode if relation has many (multi) or has one (single)


Public Methods

public onRelationButtonAdd()

public onRelationButtonAdd(): void

public onRelationButtonCreate()

public onRelationButtonCreate(): void

public onRelationButtonDelete()

public onRelationButtonDelete(): void

public onRelationButtonLink()

public onRelationButtonLink(): void

public onRelationButtonRemove()

public onRelationButtonRemove(): void

public onRelationButtonUnlink()

public onRelationButtonUnlink(): void

public onRelationButtonUpdate()

public onRelationButtonUpdate(): void

public onRelationClickManageList()

public onRelationClickManageList(): void

public onRelationClickManageListPivot()

public onRelationClickManageListPivot(): void

public onRelationClickViewList()

public onRelationClickViewList(): void

public relationGetViewFormWidget()

public relationGetViewFormWidget(): Backend\Widgets\Form|null 

relationGetManageFormWidget returns the manage form widget used by this behavior

public relationGetViewListWidget()

public relationGetViewListWidget(): Backend\Widgets\Lists|null 

relationGetViewListWidget returns the manage list widget used by this behavior

public relationGetViewWidget()

public relationGetViewWidget(): Backend\Classes\WidgetBase 

relationGetViewWidget returns the view widget used by this behavior

Protected Methods

protected evalEventTarget()

protected evalEventTarget(): string 

evalEventTarget determines the source of an AJAX event used for determining the manage mode state. See the evalManageMode method.

protected evalViewMode()

protected evalViewMode(): string 

evalViewMode determines the view mode based on the model relationship type

protected makeListStructureConfig()

protected makeListStructureConfig($config): object|null 

protected makeViewFormWidget()

protected makeViewFormWidget(): Backend\Widgets\Form|null 

makeViewFormWidget prepares the form widget for viewing

protected makeViewListWidget()

protected makeViewListWidget(): Backend\Widgets\Lists|null 

makeViewListWidget prepares the list widget for viewing

protected resetViewWidgetModel()

protected resetViewWidgetModel(): void

resetViewWidgetModel is an internal method used when deleting singular relationships