Agent xAPI statement element representing a Moodle user.
More...
|
| __construct (stdClass $data, stdClass $user) |
| Function to create an agent (user) from part of the xAPI statement. More...
|
|
|
stdClass | $data |
| the item structure.
|
|
stdClass | $user |
| The user record of this actor.
|
|
Agent xAPI statement element representing a Moodle user.
Agents can be used either as actor or object in a statement.
- Copyright
- 2020 Ferran Recio
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_xapi\local\statement\item_agent::__construct |
( |
stdClass |
$data, |
|
|
stdClass |
$user |
|
) |
| |
|
protected |
Function to create an agent (user) from part of the xAPI statement.
- Parameters
-
stdClass | $data | the original xAPI element |
stdClass | $user | user record |
◆ create_from_data()
static core_xapi\local\statement\item_agent::create_from_data |
( |
stdClass |
$data | ) |
|
|
static |
Function to create an item from part of the xAPI statement.
- Parameters
-
stdClass | $data | the original xAPI element |
- Return values
-
item | item_agentxAPI generated |
Reimplemented from core_xapi\local\statement\item_actor.
◆ create_from_user()
static core_xapi\local\statement\item_agent::create_from_user |
( |
stdClass |
$user | ) |
|
|
static |
Create a item_agent from a existing user.
- Parameters
-
stdClass | $user | A user record. |
- Return values
-
◆ get_all_users()
core_xapi\local\statement\item_agent::get_all_users |
( |
| ) |
|
Return all users represented by this item.
In this case the item is an agent so a single element array will be returned always.
- Return values
-
Reimplemented from core_xapi\local\statement\item_actor.
◆ get_data()
core_xapi\local\statement\item::get_data |
( |
| ) |
|
|
inherited |
Return the original data from this item.
- Return values
-
stdClass | the original data structure |
◆ get_user()
core_xapi\local\statement\item_agent::get_user |
( |
| ) |
|
◆ jsonSerialize()
core_xapi\local\statement\item::jsonSerialize |
( |
| ) |
|
|
inherited |
Return the data to serialize in case JSON statement is needed.
- Return values
-
stdClass | the original data structure |
The documentation for this class was generated from the following file: