Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
Moodle\H5PStorage Class Reference

This class is used for saving H5P files. More...

Public Member Functions

 __construct (H5PFrameworkInterface $H5PFramework, H5PCore $H5PCore)
 Constructor for the H5PStorage.
 
 copyPackage ($contentId, $copyFromId, $contentMainId=NULL)
 Copy/clone an H5P package.
 
 deletePackage ($content)
 Delete an H5P package.
 
 savePackage ($content=NULL, $contentMainId=NULL, $skipContent=FALSE, $options=array())
 Saves a H5P file.
 

Public Attributes

 $contentId = NULL
 
 $h5pC
 
 $h5pF
 

Detailed Description

This class is used for saving H5P files.

Constructor & Destructor Documentation

◆ __construct()

Moodle\H5PStorage::__construct ( H5PFrameworkInterface $H5PFramework,
H5PCore $H5PCore )

Constructor for the H5PStorage.

Parameters
H5PFrameworkInterface | object$H5PFrameworkThe frameworks implementation of the H5PFrameworkInterface
H5PCore$H5PCore

Member Function Documentation

◆ copyPackage()

Moodle\H5PStorage::copyPackage ( $contentId,
$copyFromId,
$contentMainId = NULL )

Copy/clone an H5P package.

May for instance be used if the content is being revisioned without uploading a new H5P package

Parameters
int$contentIdThe new content id
int$copyFromIdThe content id of the content that should be cloned
int$contentMainIdThe main id of the new content (used in frameworks that support revisioning)

◆ deletePackage()

Moodle\H5PStorage::deletePackage ( $content)

Delete an H5P package.

Parameters
$content

◆ savePackage()

Moodle\H5PStorage::savePackage ( $content = NULL,
$contentMainId = NULL,
$skipContent = FALSE,
$options = array() )

Saves a H5P file.

Parameters
null$content
int$contentMainIdThe main id for the content we are saving. This is used if the framework we're integrating with uses content id's and version id's
bool$skipContent
array$options
Return values
boolTRUE if one or more libraries were updated TRUE if one or more libraries were updated FALSE otherwise

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