Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_xapi\local\statement Class Reference

Privacy Subsystem for core_xapi implementing null_provider. More...

Inheritance diagram for core_xapi\local\statement:

Public Member Functions

 add_attachment (item_attachment $attachment)
 Adds and attachment to the statement.
 
 get_activity_id ()
 Returns the statement activity ID.
 
 get_actor ()
 Return the statement actor if it is defined.
 
 get_all_users ()
 Return all moodle users represented by this statement actor.
 
 get_attachments ()
 Return the statement attachments if it is defined.
 
 get_authority ()
 Return the statement authority if it is defined.
 
 get_context ()
 Return the statement context if it is defined.
 
 get_group ()
 Return the moodle group represented by this statement actor.
 
 get_object ()
 Return the statement object if it is defined.
 
 get_result ()
 Return the statement result if it is defined.
 
 get_stored ()
 Return the statement stored if it is defined.
 
 get_timestamp ()
 Return the statement timestamp if it is defined.
 
 get_user ()
 Returns the moodle user represented by this statement actor.
 
 get_verb ()
 Return the statement verb if it is defined.
 
 get_verb_id ()
 Returns the statement verb ID.
 
 get_version ()
 Return the statement version if it is defined.
 
 jsonSerialize ()
 Return the data to serialize in case JSON statement is needed.
 
 minify ()
 Returns a minified version of a given statement.
 
 set_actor (item_actor $actor)
 Set the statement actor.
 
 set_authority (item_actor $authority)
 Set the statement authority.
 
 set_context (item_context $context)
 Set the statement context.
 
 set_object (item_object $object)
 Set the statement object.
 
 set_result (item_result $result)
 Set the statement result.
 
 set_stored (string $stored)
 Set the statement stored.
 
 set_timestamp (string $timestamp)
 Set the statement timestamp.
 
 set_verb (item_verb $verb)
 Set the statement verb.
 
 set_version (string $version)
 Set the statement version.
 

Static Public Member Functions

static create_from_data (stdClass $data)
 Function to create a full statement from xAPI statement data.
 

Protected Attributes

item_actor $actor = null
 The statement actor.
 
item_attachment[] $attachments = null
 The statement attachments.
 
item_actor $authority = null
 The statement authority.
 
item_context $context = null
 The statement context.
 
item_object $object = null
 The statement object.
 
item_result $result = null
 The statement result.
 
string $stored = null
 The statement stored.
 
string $timestamp = null
 The statement timestamp.
 
item_verb $verb = null
 The statement verb.
 
string $version = null
 The statement version.
 

Detailed Description

Privacy Subsystem for core_xapi implementing null_provider.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_attachment()

core_xapi\local\statement::add_attachment ( item_attachment $attachment)

Adds and attachment to the statement.

Parameters
item$attachmentsattachments item element

◆ create_from_data()

static core_xapi\local\statement::create_from_data ( stdClass $data)
static

Function to create a full statement from xAPI statement data.

Parameters
stdClass$datathe original xAPI statement
Return values
statementstatement object

◆ get_activity_id()

core_xapi\local\statement::get_activity_id ( )

Returns the statement activity ID.

Exceptions
xapi_exceptionin case the item is no yet defined
Return values
stringactivity ID

◆ get_actor()

core_xapi\local\statement::get_actor ( )

Return the statement actor if it is defined.

Return values
item_actor|null

◆ get_all_users()

core_xapi\local\statement::get_all_users ( )

Return all moodle users represented by this statement actor.

Return values
arrayuser records

◆ get_attachments()

core_xapi\local\statement::get_attachments ( )

Return the statement attachments if it is defined.

Return values
item_attachment[]|null

◆ get_authority()

core_xapi\local\statement::get_authority ( )

Return the statement authority if it is defined.

Return values
item_actor|null

◆ get_context()

core_xapi\local\statement::get_context ( )

Return the statement context if it is defined.

Return values
item|null

◆ get_group()

core_xapi\local\statement::get_group ( )

Return the moodle group represented by this statement actor.

Exceptions
xapi_exceptionif it is not a group statement
Return values
stdClassa group record

◆ get_object()

core_xapi\local\statement::get_object ( )

Return the statement object if it is defined.

Return values
item_object|null

◆ get_result()

core_xapi\local\statement::get_result ( )

Return the statement result if it is defined.

Return values
item|null

◆ get_stored()

core_xapi\local\statement::get_stored ( )

Return the statement stored if it is defined.

Return values
string|null

◆ get_timestamp()

core_xapi\local\statement::get_timestamp ( )

Return the statement timestamp if it is defined.

Return values
string|null

◆ get_user()

core_xapi\local\statement::get_user ( )

Returns the moodle user represented by this statement actor.

Exceptions
xapi_exceptionif it's a group statement
Return values
stdClassuser record

◆ get_verb()

core_xapi\local\statement::get_verb ( )

Return the statement verb if it is defined.

Return values
item_verb|null

◆ get_verb_id()

core_xapi\local\statement::get_verb_id ( )

Returns the statement verb ID.

Exceptions
xapi_exceptionin case the item is no yet defined
Return values
stringverb ID

◆ get_version()

core_xapi\local\statement::get_version ( )

Return the statement version if it is defined.

Return values
string|null

◆ jsonSerialize()

core_xapi\local\statement::jsonSerialize ( )

Return the data to serialize in case JSON statement is needed.

Return values
stdClassthe statement data structure

◆ minify()

core_xapi\local\statement::minify ( )

Returns a minified version of a given statement.

The returned structure is suitable to store in the "other" field of logstore. xAPI standard specifies a list of attributes that can be calculated instead of stored literally. This function get rid of these attributes.

Note: it also converts stdClass to assoc array to make it compatible with "other" field in the logstore

Return values
arraythe minimal statement needed to be stored a part from logstore data

◆ set_actor()

core_xapi\local\statement::set_actor ( item_actor $actor)

Set the statement actor.

Parameters
item_actor$actoractor item

◆ set_authority()

core_xapi\local\statement::set_authority ( item_actor $authority)

Set the statement authority.

Parameters
item$authorityauthority item element

◆ set_context()

core_xapi\local\statement::set_context ( item_context $context)

Set the statement context.

Parameters
item_context$contextcontext item element

◆ set_object()

core_xapi\local\statement::set_object ( item_object $object)

Set the statement object.

Parameters
item_object$objectcompatible object item

◆ set_result()

core_xapi\local\statement::set_result ( item_result $result)

Set the statement result.

Parameters
item_result$resultresult item element

◆ set_stored()

core_xapi\local\statement::set_stored ( string $stored)

Set the statement stored.

Parameters
string$storedstored element

◆ set_timestamp()

core_xapi\local\statement::set_timestamp ( string $timestamp)

Set the statement timestamp.

Parameters
string$timestamptimestamp element

◆ set_verb()

core_xapi\local\statement::set_verb ( item_verb $verb)

Set the statement verb.

Parameters
item_verb$verbverb element

◆ set_version()

core_xapi\local\statement::set_version ( string $version)

Set the statement version.

Parameters
string$versionversion element

The documentation for this class was generated from the following file: