|
| __construct (string $component) |
| Constructor for a xAPI handler base class.
|
|
| cleanup () |
| Execute a state store clean up.
|
|
| delete (state $state) |
| Delete any extra state data stored in the database.
|
|
| get (state $state) |
| Get a state object from the database.
|
|
| get_state_ids (?string $itemid=null, ?int $userid=null, ?string $registration=null, ?int $since=null,) |
| Get all state ids from a specific activity and agent.
|
|
| put (state $state) |
| Inserts an state object into the database.
|
|
| reset (?string $itemid=null, ?int $userid=null, ?string $stateid=null, ?string $registration=null) |
| Reset all states from the component.
|
|
| wipe (?string $itemid=null, ?int $userid=null, ?string $stateid=null, ?string $registration=null) |
| Remove all states from the component The given parameters are filters to decide the states to wipe.
|
|
|
string | $component |
| component name in frankenstyle.
|
|
◆ __construct()
core_xapi\state_store::__construct |
( |
string | $component | ) |
|
Constructor for a xAPI handler base class.
- Parameters
-
string | $component | the component name |
◆ activity_id_to_item_id()
core_xapi\state_store::activity_id_to_item_id |
( |
string | $activityid | ) |
|
|
protected |
Convert the xAPI activity ID into an item ID integer.
- Exceptions
-
xapi_exception | if the activity id is not numeric. |
- Parameters
-
string | $activityid | the provided activity ID |
- Return values
-
◆ cleanup()
core_xapi\state_store::cleanup |
( |
| ) |
|
Execute a state store clean up.
Plugins can override this methos to provide an alternative clean up logic.
◆ delete()
core_xapi\state_store::delete |
( |
state | $state | ) |
|
Delete any extra state data stored in the database.
This method will be called only if the state is accepted by validate_state.
Plugins may override this method add extra clean up tasks to the deletion.
- Parameters
-
- Return values
-
bool | if the state is removed |
◆ get()
core_xapi\state_store::get |
( |
state | $state | ) |
|
Get a state object from the database.
This method will be called only if the state is accepted by validate_state.
Plugins may override this method if they store some data in different tables.
- Parameters
-
- Return values
-
◆ get_state_ids()
core_xapi\state_store::get_state_ids |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $registration = null, |
|
|
?int | $since = null ) |
Get all state ids from a specific activity and agent.
Plugins may override this method if they store some data in different tables.
- Parameters
-
string | null | $itemid | |
int | null | $userid | |
string | null | $registration | |
int | null | $since | filter ids updated since a specific timestamp |
- Return values
-
string[] | the state ids values |
◆ put()
core_xapi\state_store::put |
( |
state | $state | ) |
|
Inserts an state object into the database.
This method will be called only if the state is accepted by validate_state.
Plugins may override this method if they store some data in different tables.
- Parameters
-
- Return values
-
bool | if the state is inserted/updated |
◆ reset()
core_xapi\state_store::reset |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $stateid = null, |
|
|
?string | $registration = null ) |
Reset all states from the component.
The given parameters are filters to decide the states to reset. If no parameters are defined, the only filter applied will be the component.
Plugins may override this method if they store some data in different tables.
- Parameters
-
string | null | $itemid | |
int | null | $userid | |
string | null | $stateid | |
string | null | $registration | |
◆ wipe()
core_xapi\state_store::wipe |
( |
?string | $itemid = null, |
|
|
?int | $userid = null, |
|
|
?string | $stateid = null, |
|
|
?string | $registration = null ) |
Remove all states from the component The given parameters are filters to decide the states to wipe.
If no parameters are defined, the only filter applied will be the component.
Plugins may override this method if they store some data in different tables.
- Parameters
-
string | null | $itemid | |
int | null | $userid | |
string | null | $stateid | |
string | null | $registration | |
The documentation for this class was generated from the following file:
- lib/xapi/classes/state_store.php