Backend\Behaviors\UserPreferencesModel

Overview

UserPreferencesModel extension, identical to System\Behaviors\SettingsModel except values are set against the logged in user's preferences via Backend\Models\UserPreference

Add this the model class definition:

public $implement = [\Backend\Behaviors\UserPreferencesModel::class];
public $settingsCode = 'author.plugin::code';
public $settingsFields = 'fields.yaml';
Extends
See Also

Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

Protected Properties

There are no protected properties in the class.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public __construct()

public __construct($model): void

Constructor

public beforeModelSave()

public beforeModelSave(): void

Before the model is saved, ensure the record code is set and the jsonable field values

public getSettingsRecord()

public getSettingsRecord(): Model 

Returns the raw Model record that stores the settings.

public instance()

public instance(): void

Create an instance of the settings model, intended as a static method

public isConfigured()

public isConfigured(): void

Checks if the model has been set up previously, intended as a static method

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getCacheKey()

protected getCacheKey(): void

Returns a cache key for this record.

protected isKeyAllowed()

protected isKeyAllowed($key): void

Checks if a key is legitimate or should be added to the field value collection

Show inherited protected methods

Inherited Protected Methods