Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Moodle\H5PMetadata Class Reference

Static Public Member Functions

static boolifyAndEncodeSettings ($metadataSettings)
 The metadataSettings field in libraryJson uses 1 for true and 0 for false.
 
static toDBArray ($metadata, $include_title=true, $include_missing=true, &$types=array())
 Make the metadata into an associative array keyed by the property names.
 
static toJSON ($content)
 JSON encode metadata.
 

Member Function Documentation

◆ boolifyAndEncodeSettings()

static Moodle\H5PMetadata::boolifyAndEncodeSettings ( $metadataSettings)
static

The metadataSettings field in libraryJson uses 1 for true and 0 for false.

Here we are converting these to booleans, and also doing JSON encoding. This is invoked before the library data is beeing inserted/updated to DB.

Parameters
array$metadataSettings
Return values
string

◆ toDBArray()

static Moodle\H5PMetadata::toDBArray ( $metadata,
$include_title = true,
$include_missing = true,
& $types = array() )
static

Make the metadata into an associative array keyed by the property names.

Parameters
mixed$metadataArray or object containing metadata
bool$include_title
bool$include_missingFor metadata fields not being set, skip 'em. Relevant for content upgrade
array$types
Return values
array

◆ toJSON()

static Moodle\H5PMetadata::toJSON ( $content)
static

JSON encode metadata.

Parameters
object$content
Return values
string

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