-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Backend
- Behaviors
- UserPreferencesModel
Backend\Behaviors\UserPreferencesModel
Source: ~/modules/backend/behaviors/UserPreferencesModel.php
Extends:
- System\Behaviors\SettingsModel
- System\Classes\ModelBehavior
- October\Rain\Database\ModelBehavior
- October\Rain\Extension\ExtensionBase
User Preferences model 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']; public $settingsCode = 'author.plugin::code'; public $settingsFields = 'fields.yaml';
Public properties
There are no public properties in the class.
Show inherited public properties
Inherited public properties
- public static string $extendableStaticCalledClass - defined in October\Rain\Extension\ExtensionBase. The calling class when using a static method.
Protected properties
There are no protected properties in the class.
Show inherited protected properties
Inherited protected properties
- protected $recordCode - defined in System\Behaviors\SettingsModel.
- protected $fieldConfig - defined in System\Behaviors\SettingsModel.
- protected $fieldValues - defined in System\Behaviors\SettingsModel.
- protected $requiredProperties - defined in System\Behaviors\SettingsModel.
- protected October\Rain\Database\Model $model - defined in October\Rain\Database\ModelBehavior. Reference to the extended model.
- protected static array $extensionCallbacks - defined in October\Rain\Extension\ExtensionBase. Used to extend the constructor of an extension class.
- protected $extensionHidden - defined in October\Rain\Extension\ExtensionBase.
- protected string $configPath - defined in System\Behaviors\SettingsModel. Specifies a path to the config directory.
Public methods
public void __construct($model)
Constructor
Parameters
- $model
public void beforeModelSave()
Before the model is saved, ensure the record code is set and the jsonable field values
public Model getSettingsRecord()
Returns the raw Model record that stores the settings.
public void instance()
Create an instance of the settings model, intended as a static method
public void isConfigured()
Checks if the model has been set up previously, intended as a static method
Inherited public methods
- public void afterModelFetch() - defined in System\Behaviors\SettingsModel. Populate the field values from the database record.
- public void afterModelSave() - defined in System\Behaviors\SettingsModel. After the model is saved, clear the cached query entry.
- public static void clearInternalCache() - defined in System\Behaviors\SettingsModel. Clears the internal memory cache of model instances.
- public static void extend($callback) - defined in October\Rain\Extension\ExtensionBase.
- public void extensionApplyInitCallbacks() - defined in October\Rain\Extension\ExtensionBase.
- public static void extensionExtendCallback(callable $callback) - defined in October\Rain\Extension\ExtensionBase. Helper method for
::extend()
static method. - public void extensionIsHiddenField($name) - defined in October\Rain\Extension\ExtensionBase.
- public void extensionIsHiddenMethod($name) - defined in October\Rain\Extension\ExtensionBase.
- public void get($key, $default=NULL) - defined in System\Behaviors\SettingsModel. Helper for getSettingsValue, intended as a static method.
- public static void getCalledExtensionClass() - defined in October\Rain\Extension\ExtensionBase.
- public string getConfigPath(string $fileName, mixed $configPath=NULL) - defined in System\Behaviors\SettingsModel. Locates a file based on it's definition. If the file starts with.
- public void getFieldConfig() - defined in System\Behaviors\SettingsModel. Returns the field configuration used by this model.
- public void getSettingsValue($key, $default=NULL) - defined in System\Behaviors\SettingsModel. Get a single setting value, or return a default value.
- public string guessConfigPath(string $suffix='') - defined in System\Behaviors\SettingsModel. Guess the package path for the called class.
- public string guessConfigPathFrom(string $class, string $suffix='') - defined in System\Behaviors\SettingsModel. Guess the package path from a specified class.
- public void initSettingsData() - defined in System\Behaviors\SettingsModel. Default values to set for this model, override.
- public array|stdClass makeConfig(array $configFile=array(), array $requiredConfig=array()) - defined in System\Behaviors\SettingsModel. Reads the contents of the supplied file and applies it to this object.
- public stdClass makeConfigFromArray(array $configArray=array()) - defined in System\Behaviors\SettingsModel. Makes a config object from an array, making the first level keys properties of a new object.
- public stdClass mergeConfig(mixed $configA, mixed $configB) - defined in System\Behaviors\SettingsModel. Merges two configuration sources, either prepared or not, and returns.
- public void resetDefault() - defined in System\Behaviors\SettingsModel. Reset the settings to their defaults, this will delete the record model.
- public void saveModelInternal() - defined in System\Behaviors\SettingsModel. Internal save method for the model.
- public void set($key, $value=NULL) - defined in System\Behaviors\SettingsModel. Set a single or array key pair of values, intended as a static method.
- public void setSettingsValue($key, $value) - defined in System\Behaviors\SettingsModel. Set a single setting value, if allowed.
Protected methods
protected void getCacheKey()
Returns a cache key for this record.
protected void isKeyAllowed($key)
Checks if a key is legitimate or should be added to the field value collection
Parameters
- $key
Show inherited protected methods
Inherited protected methods
- protected void extensionHideField($name) - defined in October\Rain\Extension\ExtensionBase.
- protected void extensionHideMethod($name) - defined in October\Rain\Extension\ExtensionBase.