RetrievalTrait
Table of Contents
- all() : array<string|int, static>
- Get a list of all active objects of the calling class (user, role, session, organization, API key)
- byId() : static|null
- Get an object (user, role, session, organization or API key) by its id
- byIdentifier() : object|null
- Get a permission object (user or role) by one of its identifiers
- byIdentifiers() : array<string|int, object>
- Get a list of permission objects (user or role) by one of their identifiers
- byIds() : array<string|int, static>
- Get a list of objects (user, role, session, organization or API key) by their ids Unknown or inactive ids are skipped, and calling it without ids throws a database exception
- byUuid() : object|null
- Get a permission object (user or role) by its uuid
- byUuids() : array<string|int, object>
- Get a list of permission objects (user or role) by their uuids
Methods
all()
Get a list of all active objects of the calling class (user, role, session, organization, API key)
public
static all() : array<string|int, static>
Return values
array<string|int, static> —The list of active objects
byId()
Get an object (user, role, session, organization or API key) by its id
public
static byId(int|string $id) : static|null
Parameters
- $id : int|string
-
the id of the object
Return values
static|null —the object if found, null if the id is unknown or inactive
byIdentifier()
Get a permission object (user or role) by one of its identifiers
public
static byIdentifier(string $column, int|string $identifier) : object|null
Parameters
- $column : string
-
The identifying column, e.g. "id" or "uuid"
- $identifier : int|string
-
The value of the identifying column
Return values
object|null —the permission object if found, null otherwise
byIdentifiers()
Get a list of permission objects (user or role) by one of their identifiers
public
static byIdentifiers(string $column, array<string|int, int>|array<string|int, string> $identifiers) : array<string|int, object>
Parameters
- $column : string
-
The identifying column, e.g. "id" or "uuid"
- $identifiers : array<string|int, int>|array<string|int, string>
-
The values of the identifying column
Return values
array<string|int, object> —The list of permission objects
byIds()
Get a list of objects (user, role, session, organization or API key) by their ids Unknown or inactive ids are skipped, and calling it without ids throws a database exception
public
static byIds(int ...$ids) : array<string|int, static>
Parameters
- $ids : int
-
The ids of the objects to retrieve
Return values
array<string|int, static> —the objects that were found
byUuid()
Get a permission object (user or role) by its uuid
public
static byUuid(string $uuid) : object|null
Parameters
- $uuid : string
-
the uuid of the object
Return values
object|null —the permission object if found, null otherwise
byUuids()
Get a list of permission objects (user or role) by their uuids
public
static byUuids(string ...$uuids) : array<string|int, object>
Parameters
- $uuids : string
-
The uuids of the objects to retrieve
Return values
array<string|int, object> —The list of permission objects