update_item_dto
class update_item_dto extends item_dto
| internal |
DTO strictly for Item updates.
Ensures ID is present and allows partial field updates.
Methods
array
jsonSerialize()
Default implementation to serialize to JSON using the array representation.
from
abstract_dto
__construct(int|null $id, string|null $type = null, int|null $contextid = null, int|null $courseid = null, int|null $userid = null, int|null $parent = null, string|null $fullname = null, string|null $shortname = null, string|null $idnumber = null, string|null $description = null, int|null $descriptionformat = null, string|null $status = null, int|null $visible = null, string|null $guid = null, int|null $sortorder = null, string|null $version = null, int|null $usermodified = null, array $metadata = [])
Constructor.
static item_dto
from_array(array $data)
Create a DTO from an associative array (e.g. form data or JSON).
from
item_dto
Details
in
abstract_dto at line 38
array
jsonSerialize()
Default implementation to serialize to JSON using the array representation.
at line 51
__construct(int|null $id, string|null $type = null, int|null $contextid = null, int|null $courseid = null, int|null $userid = null, int|null $parent = null, string|null $fullname = null, string|null $shortname = null, string|null $idnumber = null, string|null $description = null, int|null $descriptionformat = null, string|null $status = null, int|null $visible = null, string|null $guid = null, int|null $sortorder = null, string|null $version = null, int|null $usermodified = null, array $metadata = [])
Constructor.
in
item_dto at line 96
static item_dto
from_array(array $data)
Create a DTO from an associative array (e.g. form data or JSON).
Keys not present in the array will remain null (not updated). Unknown keys are ignored.
in
item_dto at line 127
array
to_array()
Convert DTO to an array, filtering out null values.
Useful for repository methods that should receive only changed fields.