ModuleData

class \TYPO3\CMS\Backend\Module\ModuleData

A simple DTO containing the user specific module settings, e.g. whether the clipboard is shown.

The DTO is created in the PSR-15 middleware BackendModuleValidator, in case a backend module is requested and the user has necessary access permissions. The created DTO is then added as attribute to the PSR-7 Request and can be further used in components, such as middlewares or the route target (usually a backend controller).

Tags

see
BackendModuleValidator

Table of Contents

Properties

$defaultData  : array
$moduleIdentifier  : string
$properties  : array

Methods

__construct()  : mixed
clean()  : bool
Cleans a single property by the given allowed list. First fallback is the default data list. If this list does also not contain an allowed value, the first value from the allowed list is taken.
cleanUp()  : bool
Cleans up all module data, which are defined in the given allowed data list. Usually called with $MOD_MENU.
createFromModule()  : self
get()  : mixed
getModuleIdentifier()  : string
has()  : bool
set()  : void
toArray()  : array

Properties

$defaultData

protected array $defaultData = []

$moduleIdentifier

protected string $moduleIdentifier

$properties

protected array $properties = []

Methods

__construct()

public __construct(string $moduleIdentifier, array $data[, array $defaultData = [] ]) : mixed

Parameters

$moduleIdentifier : string
$data : array
$defaultData : array = []

clean()

Cleans a single property by the given allowed list. First fallback is the default data list. If this list does also not contain an allowed value, the first value from the allowed list is taken.

public clean(string $propertyName, array $allowedValues) : bool

Parameters

$propertyName : string
$allowedValues : array

Return values

bool —

True if something has been cleaned up

cleanUp()

Cleans up all module data, which are defined in the given allowed data list. Usually called with $MOD_MENU.

public cleanUp(array $allowedData[, bool $useKeys = true ]) : bool

Parameters

$allowedData : array
$useKeys : bool = true

Return values

bool

get()

public get(string $propertyName[, mixed $default = null ]) : mixed

Parameters

$propertyName : string
$default : mixed = null

getModuleIdentifier()

public getModuleIdentifier() : string

Return values

string

has()

public has(string $propertyName) : bool

Parameters

$propertyName : string

Return values

bool

set()

public set(string $propertyName, mixed $value) : void

Parameters

$propertyName : string
$value : mixed

toArray()

public toArray() : array

Return values

array
On this page