Backend\FormWidgets\RecordFinder

Overview

RecordFinder renders a record finder field

user: label: User type: recordfinder list: ~/plugins/rainlab/user/models/user/columns.yaml recordsPerPage: 10 title: Find Record keyFrom: id nameFrom: name descriptionFrom: email conditions: email = "bob@example.com" scope: whereActive searchMode: all searchScope: searchUsers useRelation: false modelClass: RainLab\User\Models\User

Extends

Public Properties

public string $keyFrom

keyFrom is the field name to use for key

public string $nameFrom

nameFrom is the relation column to display for the name

public string $descriptionFrom

descriptionFrom is the relation column to display for the description

public string $title

title text to display for the title of the popup list form

public int $recordsPerPage

recordsPerPage is the maximum rows to display for each page

public string $scope

scope uses a custom scope method for the list query.

public string $conditions

conditions filters the relation using a raw where query statement.

public mixed $defaultSort

defaultSort column to look for.

public string $searchMode

searchMode if searching the records, specifies a policy to use.

  • all: result must contain all words
  • any: result can contain any word
  • exact: result must contain the exact phrase

public string $searchScope

searchScope uses a custom scope method for performing searches.

public boolean $useRelation

useRelation flag for using the name of the field as a relation name to interact with directly on the parent model. Default: true. Disable to return just the selected model's ID

public string $modelClass

modelClass of the model to use for listing records when useRelation = false

public string $popupSize

popupSize as, either giant, huge, large, small, tiny or adaptive

public Model $relationModel

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

protected string|int $relationKeyValue

protected Backend\Widgets\Lists $listWidget

listWidget reference to the widget used for viewing (list or form).

protected Backend\Widgets\Search $searchWidget

searchWidget reference to the widget used for searching

protected Backend\Widgets\Filter $filterWidget

filterWidget reference to the widget used for filtering

Show inherited protected properties

Inherited Protected Properties


Public Methods

public getDescriptionValue()

public getDescriptionValue(): void

public getKeyValue()

public getKeyValue(): void

public getLoadValue()

public getLoadValue(): void

getLoadValue returns the value for this form field, supports nesting via HTML array.

public getNameValue()

public getNameValue(): void

public getSaveValue()

public getSaveValue($value): void

getSaveValue processes the postback value for this widget. If the value is omitted from postback data, the form widget will be skipped.

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public nearestModelAttribute()

public nearestModelAttribute($attribute): void

public onClearRecord()

public onClearRecord(): void

onClearRecord AJAX handler

public onFindRecord()

public onFindRecord(): void

onFindRecord AJAX handler

public onRefresh()

public onRefresh(): void

onRefresh AJAX handler

public prepareVars()

public prepareVars(): void

prepareVars for display

public render()

public render(): void

render the widget's primary contents.

public resolveModelAttribute()

public resolveModelAttribute(string $attribute): array 

Returns the final model and attribute name of a nested HTML array attribute. Eg: [$model, $attribute] = $this->resolveModelAttribute($this->valueFrom);

public setKeyValue()

public setKeyValue($value): void

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getKeyFromAttributeName()

protected getKeyFromAttributeName(): void

protected getRelationModel()

protected getRelationModel(): Relation 

Returns the model of a relation type, supports nesting via HTML array.

protected getRelationObject()

protected getRelationObject(): Relation 

Returns the value as a relation object from the model, supports nesting via HTML array.

protected getRelationType()

protected getRelationType(): string 

getRelationType returns the value as a relation type from the model, supports nesting via HTML array.

protected isRelationTypeSingular()

protected isRelationTypeSingular(): bool 

isRelationTypeSingular checks if the related model is singular.

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

protected makeFilterWidget()

protected makeFilterWidget(): void

protected makeListWidget()

protected makeListWidget(): void

protected makeSearchWidget()

protected makeSearchWidget(): void

Show inherited protected methods

Inherited Protected Methods