KeyBuilder
in
Contract for assembling a string key from an FSM {@see StorageKey} and an optional sub-record discriminator.
Mirrors the abstract base class aiogram.fsm.storage.base.KeyBuilder
(aiogram/fsm/storage/base.py:24-39). In Python the contract is expressed
as an ABC with an @abstractmethod; in PHP an interface carries the
same semantics with less boilerplate.
Implementors receive a fully-constructed StorageKey and an optional
StoragePart discriminator, and must return the opaque string that the
storage backend will use as the record key (e.g. a Redis key or a MongoDB
document _id).
Table of Contents
Methods
- build() : string
- Build the storage key string for the given FSM context.
Methods
build()
Build the storage key string for the given FSM context.
public
build(StorageKey $key[, null|StoragePart $part = null ]) : string
Parameters
- $key : StorageKey
-
Contextual key carrying bot/chat/user/destiny coordinates.
- $part : null|StoragePart = null
-
Sub-record discriminator (
data,state,lock), ornullto address the entry without a part suffix.
Return values
string —Opaque key string suitable for use as a storage backend record address.