IAttributes
in
Interface IAttributes
Tags
Table of Contents
Methods
- getAttribute() : bool|null
- Returns if attribute is enabled/disabled for given scope id and key.
- setAttribute() : IAttributes
- Sets an attribute enabled/disabled. If the key did not exist before it will be created.
- toArray() : array<string|int, mixed>
- Formats the IAttributes object to array with the following format: [ 0 => [ "scope" => <string>, "key" => <string>, "enabled" => <bool> ], ... ]
Methods
getAttribute()
Returns if attribute is enabled/disabled for given scope id and key.
public
getAttribute(string $scope, string $key) : bool|null
If attribute does not exist, returns null
Parameters
- $scope : string
-
scope
- $key : string
-
key
Tags
Return values
bool|nullsetAttribute()
Sets an attribute enabled/disabled. If the key did not exist before it will be created.
public
setAttribute(string $scope, string $key, bool $enabled) : IAttributes
Parameters
- $scope : string
-
scope
- $key : string
-
key
- $enabled : bool
-
enabled
Tags
Return values
IAttributes —The modified object
toArray()
Formats the IAttributes object to array with the following format: [ 0 => [ "scope" => <string>, "key" => <string>, "enabled" => <bool> ], ... ]
public
toArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —formatted IAttributes