TypeManager
in package
Provides utility functions to get e.g. configured types.
Tags
Table of Contents
- $config : mixed
- __construct() : mixed
- Constructor
- generateNewTypeId() : mixed
- Generates a new unique type id for the given scope.
- getConfig() : LAMConfig
- Returns the associated config object.
- getConfiguredType() : ConfiguredType|null
- Returns the configured type with the given id or null.
- getConfiguredTypes() : array<string|int, ConfiguredType>
- Returns a list of configured account types.
- getConfiguredTypesForScope() : array<string|int, ConfiguredType>
- Returns a list of configured types for this scope.
- getConfiguredTypesForScopes() : array<string|int, ConfiguredType>
- Returns a list of configured types for these scopes.
- hasConfig() : bool
- Returns if configuration is loaded.
- isValidTypeId() : bool
- Checks if the given type id is valid.
- buildConfiguredType() : mixed
- Builds a configured account type.
Properties
$config
private
mixed
$config
Methods
__construct()
Constructor
public
__construct([LAMConfig &$config = null ]) : mixed
Parameters
- $config : LAMConfig = null
-
configuration (uses $_SESSION['config'] by default)
Return values
mixed —generateNewTypeId()
Generates a new unique type id for the given scope.
public
generateNewTypeId(string $scope) : mixed
Parameters
- $scope : string
-
account type (e.g. user)
Return values
mixed —getConfig()
Returns the associated config object.
public
getConfig() : LAMConfig
Return values
LAMConfig —config
getConfiguredType()
Returns the configured type with the given id or null.
public
getConfiguredType(string $typeId) : ConfiguredType|null
Parameters
- $typeId : string
-
type id
Return values
ConfiguredType|null —type
getConfiguredTypes()
Returns a list of configured account types.
public
getConfiguredTypes() : array<string|int, ConfiguredType>
Return values
array<string|int, ConfiguredType> —list of ConfiguredType
getConfiguredTypesForScope()
Returns a list of configured types for this scope.
public
getConfiguredTypesForScope(string $scope) : array<string|int, ConfiguredType>
Parameters
- $scope : string
-
scope (e.g. user)
Return values
array<string|int, ConfiguredType> —list of ConfiguredType
getConfiguredTypesForScopes()
Returns a list of configured types for these scopes.
public
getConfiguredTypesForScopes(array<string|int, mixed> $scopes) : array<string|int, ConfiguredType>
Parameters
- $scopes : array<string|int, mixed>
-
scopes (e.g. user)
Return values
array<string|int, ConfiguredType> —list of ConfiguredType
hasConfig()
Returns if configuration is loaded.
public
hasConfig() : bool
Return values
bool —configured
isValidTypeId()
Checks if the given type id is valid.
public
static isValidTypeId(string $typeId) : bool
Parameters
- $typeId : string
-
type id
Return values
bool —is valid
buildConfiguredType()
Builds a configured account type.
private
buildConfiguredType(string $typeId) : mixed
Parameters
- $typeId : string
-
type id