Class to represent a content item.
More...
|
| Item | getItem () |
| | Get content item.
|
| bool | delete (Platform $platform) |
| | Delete a content-item.
|
| string | toJson () |
| | Wrap the content item to form a JSON string.
|
| object | toJsonObject () |
| | Wrap the content items to form a JSON object of the value.
|
|
|
array | $readonly = null |
| | Readonly properties.
|
|
| bool | fromJsonObject (object $obj) |
| | Extract content item details from its JSON representation.
|
Class to represent a content item.
- Author
- Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
- Copyright
- SPV Software Products
- Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3
◆ delete()
Delete a content-item.
- Parameters
-
| Platform | $platform | Platform object |
- Returns
- bool True if successful
References fromType().
◆ fromEndpoint()
Retrieve a content item definition.
- Parameters
-
| Platform | $platform | Platform object |
| string | $endpoint | ID value |
- Returns
- ContentItem|bool ContentItem object or false on error
References Util\$strictMode.
Referenced by fromType().
◆ fromJsonItem()
Generate a Content Item object from its JSON representation.
- Parameters
-
| object | $item | A JSON object representing a content item |
- Returns
- ContentItem|LtiLinkContentItem|null The content item object
Referenced by toJsonObject().
◆ fromJsonObject()
| bool fromJsonObject |
( |
object | $obj | ) |
|
|
protected |
Extract content item details from its JSON representation.
- Parameters
-
| object | $obj | A JSON object representing a content item |
- Returns
- bool True if the item is valid
Reimplemented in LtiLinkContentItem.
◆ fromType()
Generate a Content Item object from its type.
- Parameters
-
| string | $type | Type of content item |
| string | null | $id | Endpoint of content item |
- Returns
- ContentItem|LtiLinkContentItem|null The content item object
References fromEndpoint().
Referenced by delete().
◆ getItem()
Get content item.
- Returns
- Item Item object for this content item.
References $item.
◆ toJson()
Wrap the content item to form a JSON string.
- Returns
- string
◆ toJsonObject()