This class represents the content of a Courseware container stored in payload.
- Author
- Marcus Eibrink-Lunzenauer lunze.nosp@m.naue.nosp@m.r@ela.nosp@m.n-ev.nosp@m..de
-
Ron Lucke lucke.nosp@m.@ela.nosp@m.n-ev..nosp@m.de GPL2 or any later version
- Since
- Stud.IP 5.0
◆ __construct()
- Parameters
-
\Courseware\Container | $container | the container associated to this type |
◆ addBlock()
addBlock |
( |
|
$block, |
|
|
|
$sectionIndex |
|
) |
| |
|
abstract |
Adds a block id to payload of the container
- Parameters
-
/Courseware/Block | $block - block to be added to the container |
◆ copyPayload()
copyPayload |
( |
array |
$block_map = [] | ) |
|
◆ decodePayloadString()
decodePayloadString |
( |
string |
$payload | ) |
|
|
protected |
Decode a given payload.
- Parameters
-
string | $payload | the payload to be decoded |
- Returns
- mixed the decoded payload
◆ factory()
◆ findContainerType()
static findContainerType |
( |
string |
$containerType | ) |
|
|
static |
Returns the classname of a container type whose type
equals the given one.
- Parameters
-
string | $containerType | a short string describing a type of container; see getType |
- Returns
- ?string either the classname if the given type was valid; null otherwise
◆ getContainerTypes()
static getContainerTypes |
( |
| ) |
|
|
static |
Returns all known types of containers: core types and plugin types as well.
- Returns
- array<string> a list of all known types of containers; each one a fully qualified class name
◆ getContainerWidth()
Returns a containers width as a description.
- Returns
- string the description
◆ getDescription()
static getDescription |
( |
| ) |
|
|
staticabstract |
Returns the description of this type of containers suitable to display it to the user.
- Returns
- string the description of this type of containers
◆ getJsonSchema()
Returns the JSON schema which is used to validate the payload of instances of this type of container.
- Returns
- string the JSON schema to be used
◆ getPayload()
Returns the decoded payload of the block associated with this instance.
- Returns
- mixed the decoded payload
◆ getPdfHtmlTemplate()
Gets the related container's html template if exists otherwise a default one, to be exported as pdf if exists.
It turns the classname into snakecase in order to find the template file in templates/courseware/container_types.
- Returns
- |null the instance if exists, otherwise null.
◆ getTitle()
Returns the title of this type of containers suitable to display it to the user.
- Returns
- string the title of this type of containers
◆ getType()
Returns a short string describing this type of container.
- Returns
- string the short string describing this type
◆ initialPayload()
Returns the initial payload of every instance of this type of container.
- Returns
- array<mixed> the initial payload of an instance of this type of container
◆ isContainerType()
static isContainerType |
( |
string |
$containerType | ) |
|
|
static |
- Parameters
-
string | $containerType | a short string describing a type of container; see getType |
- Returns
- bool true, if the given type of container is valid; false otherwise
◆ setPayload()
Encodes the payload and sets it in the associated block.
- Parameters
-
mixed | $payload | the payload to be encoded |
◆ validatePayload()
validatePayload |
( |
|
$payload | ) |
|
Validates a given payload according to the JSON schema of this type of container.
- Parameters
-
mixed | $payload | the payload to be validated |
- Returns
- bool true, if the given payload is valid; false otherwise
◆ $container
The documentation for this class was generated from the following file: