Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | List of all members
core_badges_assertion Class Reference

Open Badges Assertions specification 1.0 More...

Public Member Functions

 __construct ($hash, $obversion=OPEN_BADGES_V2)
 Constructs with issued badge unique hash. More...
 
 get_alignments ()
 Get alignment of the badge. More...
 
 get_assertion_hash ()
 Get the local id for this badge assertion. More...
 
 get_badge_assertion ($issued=true, $usesalt=true)
 Get badge assertion. More...
 
 get_badge_class ($issued=true)
 Get badge class information. More...
 
 get_badge_id ()
 Get the local id for this badge. More...
 
 get_criteria_badge_class ()
 Get criteria of badge class. More...
 
 get_endorsement ()
 Get endorsement of the badge. More...
 
 get_issuer ()
 Get badge issuer information. More...
 
 get_related_badges (badge $badge)
 Get related badges of the badge. More...
 

Protected Member Functions

 embed_data_badge_version2 (&$json, $type=OPEN_BADGES_V2_TYPE_ASSERTION)
 Embed data of Open Badges Specification Version 2.0 to json. More...
 

Detailed Description

Open Badges Assertions specification 1.0

Badge asserion is defined by three parts:

Constructor & Destructor Documentation

◆ __construct()

core_badges_assertion::__construct (   $hash,
  $obversion = OPEN_BADGES_V2 
)

Constructs with issued badge unique hash.

Parameters
string$hashBadge unique hash from badge_issued table.
int$obversionto control version JSON-LD.

Member Function Documentation

◆ embed_data_badge_version2()

core_badges_assertion::embed_data_badge_version2 ( $json,
  $type = OPEN_BADGES_V2_TYPE_ASSERTION 
)
protected

Embed data of Open Badges Specification Version 2.0 to json.

Parameters
array$jsonfor assertion, badges, issuer.
string$typeContent type.

◆ get_alignments()

core_badges_assertion::get_alignments ( )

Get alignment of the badge.

Return values
arrayinformation.

◆ get_assertion_hash()

core_badges_assertion::get_assertion_hash ( )

Get the local id for this badge assertion.

Return values
string

◆ get_badge_assertion()

core_badges_assertion::get_badge_assertion (   $issued = true,
  $usesalt = true 
)

Get badge assertion.

Parameters
boolean$issuedInclude the nested badge issued information.
boolean$usesaltHash the identity and include the salt information for the hash.
Return values
arrayBadge assertion.

◆ get_badge_class()

core_badges_assertion::get_badge_class (   $issued = true)

Get badge class information.

Parameters
boolean$issuedInclude the nested badge issuer information.
Return values
arrayBadge Class information.

◆ get_badge_id()

core_badges_assertion::get_badge_id ( )

Get the local id for this badge.

Return values
int

◆ get_criteria_badge_class()

core_badges_assertion::get_criteria_badge_class ( )

Get criteria of badge class.

Return values
array|stringCriteria information.

◆ get_endorsement()

core_badges_assertion::get_endorsement ( )

Get endorsement of the badge.

Return values
false|stdClassEndorsement information.

◆ get_issuer()

core_badges_assertion::get_issuer ( )

Get badge issuer information.

Return values
arrayIssuer information.

◆ get_related_badges()

core_badges_assertion::get_related_badges ( badge  $badge)

Get related badges of the badge.

Parameters
badge$badgeBadge object.
Return values
array|boolList related badges.

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