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