This class represents the content of a Courseware block stored in payload.
- Author
- Marcus Eibrink-Lunzenauer lunze.nosp@m.naue.nosp@m.r@ela.nosp@m.n-ev.nosp@m..de
-
Till Glöggler gloeg.nosp@m.gler.nosp@m.@elan.nosp@m.-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
(PHPMD.CouplingBetweenObjects)
◆ __construct()
- Parameters
-
\Courseware\Block | $block | the block associated to this type |
◆ copyFileById()
copyFileById |
( |
string |
$fileId, |
|
|
string |
$rangeId |
|
) |
| |
|
protected |
Copies a file to a specified range.
- Parameters
-
string | $fileId | the ID of the file |
string | $rangeId | the ID of the range |
- Returns
- string the ID of the copy
◆ copyFolderById()
copyFolderById |
( |
string |
$folderId, |
|
|
string |
$rangeId |
|
) |
| |
|
protected |
Copies a folder to a specified range.
- Parameters
-
string | $fileId | the ID of the folder |
string | $rangeId | the ID of the range |
- Returns
- string the ID of the copy
◆ copyPayload()
copyPayload |
( |
string |
$rangeId = '' | ) |
|
◆ decodePayloadString()
decodePayloadString |
( |
string |
$payload | ) |
|
|
protected |
Decode a given payload.
- Parameters
-
string | $payload | the payload to be decoded |
- Returns
- mixed the decoded payload
◆ factory()
Creates an instance of BlockType for a given block.
- Parameters
-
\Courseware\Block | $block | the block whose BlockType is returned |
- Returns
- BlockType the BlockType associated with the given block
◆ findBlockType()
static findBlockType |
( |
string |
$blockType | ) |
|
|
static |
Returns the classname of a block type whose type
equals the given one.
- Parameters
-
string | $blockType | a short string describing a type of block; see getType |
- Returns
- mixed either the classname if the given type was valid; null otherwise
◆ getBlockTypes()
Returns all known types of containers: core types and plugin types as well.
- Returns
- array<string> a list of all known types of blocks; each one a fully qualified class name
◆ getCategories()
Returns a list of categories to which this type of block is associated.
- Returns
- array the list of categories
◆ getContentTypes()
static getContentTypes |
( |
| ) |
|
|
staticabstract |
Returns a list of content types to which this type of block is associated.
- Returns
- array the list of content types
◆ getDescription()
static getDescription |
( |
| ) |
|
|
staticabstract |
Returns the description of this type of blocks suitable to display it to the user.
- Returns
- string the description of this type of blocks
◆ getFeedback()
Returns all feedback of the block.
- Returns
- array<array> a list of feedback objects
◆ getFileById()
getFileById |
( |
string |
$fileId | ) |
|
|
protected |
Casts a of a given ID to an array and returns that.
- Parameters
-
string | $fileId | the ID of the |
- Returns
- array either an empty array if there is no such or that cast to an array
◆ getFileRefById()
getFileRefById |
( |
string |
$fileId | ) |
|
|
protected |
◆ getFiles()
Returns a list of files associated to the block.
- Returns
- array the list of files
◆ getFileTypes()
Returns a list of file types to which this type of block is associated.
- Returns
- array the list of file types
◆ getJsonSchema()
Returns the JSON schema which is used to validate the payload of instances of this type of block.
- 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 block'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/block_types.
- Returns
- |null the instance if exists, otherwise null.
◆ getTags()
Returns a list of tags to which this type of block is associated.
- Returns
- array the list of tags
◆ getTitle()
Returns the title of this type of blocks suitable to display it to the user.
- Returns
- string the title of this type of blocks
◆ getType()
Returns a short string describing this type of blocks.
- Returns
- string the short string describing this type
◆ initialPayload()
Returns the initial payload of every instance of this type of block.
- Returns
- array<mixed> the initial payload of an instance of this type of block
◆ isBlockType()
static isBlockType |
( |
string |
$blockType | ) |
|
|
static |
- Parameters
-
string | $blockType | a short string describing a type of block; see getType |
- Returns
- bool true, if the given type of block 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 block.
- Parameters
-
mixed | $payload | the payload to be validated |
- Returns
- bool true, if the given payload is valid; false otherwise
◆ $block
The documentation for this class was generated from the following file: