H5P Content manager class.
More...
|
stdClass | $content = null |
| $content The content of the current instance.
|
|
H5P Content manager class.
- Copyright
- 2020 Amaia Anabitarte amaia.nosp@m.@moo.nosp@m.dle.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_configdata()
core_contentbank\content::get_configdata |
( |
| ) |
|
|
inherited |
Return the content config values.
- Return values
-
mixed | Config information for this content (json decoded) |
◆ get_content()
core_contentbank\content::get_content |
( |
| ) |
|
|
inherited |
Returns $this->content.
- Return values
-
stdClass\$this-,>content. | |
◆ get_content_type()
core_contentbank\content::get_content_type |
( |
| ) |
|
|
inherited |
Returns $this->content->contenttype.
- Return values
-
string\$this-,>content->contenttype. | |
◆ get_content_type_instance()
core_contentbank\content::get_content_type_instance |
( |
| ) |
|
|
inherited |
Return the contenttype instance of this content.
- Return values
-
contenttype | The content type instance |
◆ get_contextid()
core_contentbank\content::get_contextid |
( |
| ) |
|
|
inherited |
Returns the contextid of the content.
- Return values
-
int | The id of the content context. |
◆ get_file()
core_contentbank\content::get_file |
( |
| ) |
|
|
inherited |
Returns the $file related to this content.
- Return values
-
- Exceptions
-
◆ get_file_url()
core_contentbank\content::get_file_url |
( |
| ) |
|
|
inherited |
Returns the file url related to this content.
- Return values
-
string | URL of the file stored in content bank area related to the given itemid. |
- Exceptions
-
◆ get_id()
core_contentbank\content::get_id |
( |
| ) |
|
|
inherited |
Returns the content ID.
- Return values
-
◆ get_instanceid()
core_contentbank\content::get_instanceid |
( |
| ) |
|
|
inherited |
Returns the $instanceid of this content.
- Return values
-
int | contentbank instanceid |
◆ get_name()
core_contentbank\content::get_name |
( |
| ) |
|
|
inherited |
Returns the name of the content.
- Return values
-
string | The name of the content. |
◆ get_timemodified()
core_contentbank\content::get_timemodified |
( |
| ) |
|
|
inherited |
Returns $this->content->timemodified.
- Return values
-
int\$this-,>content->timemodified. | |
◆ get_uses()
core_contentbank\content::get_uses |
( |
| ) |
|
|
inherited |
Returns the places where the file associated to this content is used or an empty array if the content has no file.
- Return values
-
array | of stored_file where current file content is used or empty array if it hasn't any file. |
- Since
- 3.11
◆ get_visibility()
core_contentbank\content::get_visibility |
( |
| ) |
|
|
inherited |
Return true if the content may be shown to other users in the content bank.
- Return values
-
◆ import_file() [1/2]
contenttype_h5p\content::import_file |
( |
\stored_file | $file | ) |
|
Import a file as a valid content.
Before importing the file, this method will check if the file is a valid H5P package. If it's not valid, it will thrown an exception.
- Exceptions
-
- Parameters
-
- Return values
-
stored_file|null | the stored content file or null if the file is discarted. |
◆ import_file() [2/2]
core_contentbank\content::import_file |
( |
stored_file | $file | ) |
|
|
inherited |
Import a file as a valid content.
By default, all content has a public file area to interact with the content bank repository. This method should be overridden by contentypes which does not simply upload to the public file area.
If any, the method will return the final stored_file. This way it can be invoked as parent\import_file in case any plugin want to store the file in the public area and also parse it.
- Exceptions
-
- Parameters
-
- Return values
-
stored_file|null | the stored content file or null if the file is discarted. |
◆ is_view_allowed()
contenttype_h5p\content::is_view_allowed |
( |
| ) |
|
Returns user has access permission for the content itself.
If the H5P content-type library is disabled, the user won't have access to it.
- Return values
-
bool | True if content could be accessed. False otherwise. |
Reimplemented from core_contentbank\content.
◆ set_configdata()
core_contentbank\content::set_configdata |
( |
string | $configdata | ) |
|
|
inherited |
Change the content config values.
- Parameters
-
string | $configdata | New config information for this content |
- Return values
-
boolean | True if the configdata has been succesfully updated. False otherwise. |
◆ set_contextid()
core_contentbank\content::set_contextid |
( |
int | $contextid | ) |
|
|
inherited |
Set a new contextid to the content.
- Parameters
-
int | $contextid | The new contextid of the content. |
- Return values
-
bool | True if the content has been succesfully updated. False otherwise. |
◆ set_instanceid()
core_contentbank\content::set_instanceid |
( |
int | $instanceid | ) |
|
|
inherited |
Change the content instanceid value.
- Parameters
-
int | $instanceid | New instanceid for this content |
- Return values
-
boolean | True if the instanceid has been succesfully updated. False otherwise. |
◆ set_name()
core_contentbank\content::set_name |
( |
string | $name | ) |
|
|
inherited |
Set a new name to the content.
- Parameters
-
string | $name | The name of the content. |
- Return values
-
bool | True if the content has been succesfully updated. False otherwise. |
- Exceptions
-
◆ set_visibility()
core_contentbank\content::set_visibility |
( |
int | $visibility | ) |
|
|
inherited |
Sets a new content visibility and saves it to database.
- Parameters
-
int | $visibility | Must be self\PUBLIC or self\UNLISTED |
- Return values
-
- Exceptions
-
◆ update_content()
core_contentbank\content::update_content |
( |
| ) |
|
|
inherited |
Updates content_bank table with information in $this->content.
- Return values
-
boolean | True if the content has been succesfully updated. False otherwise. |
- Exceptions
-
◆ VISIBILITY_PUBLIC
int const core_contentbank\content::VISIBILITY_PUBLIC = 1 |
|
inherited |
Visibility value.
Public content is visible to all users with access to the content bank of the appropriate context.
◆ VISIBILITY_UNLISTED
int const core_contentbank\content::VISIBILITY_UNLISTED = 2 |
|
inherited |
Visibility value.
Unlisted content is only visible to the author and to users with moodle/contentbank:viewunlistedcontent capability.
The documentation for this class was generated from the following file:
- contentbank/contenttype/h5p/classes/content.php