class plugin_dto extends abstract_dto implements Stringable

internal  
 

Data Transfer Object representing a Moodle plugin.

Abstracts the core plugininfo structure into a serializable, immutable representation for domain/services without leaking Moodle internals.

Methods

array
jsonSerialize()

Default implementation to serialize to JSON using the array representation.

__construct(string $type, string $name, string $component, string|null $rootdir, string|null $displayname, string|null $source, int|string|null $versiondisk, int|string|null $versiondb, float|int|string|null $versionrequires, array|null $dependencies, bool|null $enabled, string|null $release, array|null $supported, int|null $incompatible, string|null $status)

No description

string
__toString()

String representation (component name).

array
to_array()

Convert to associative array with key metadata.

to_object()

Convert to stdClass for compatibility layers.

bool
exists_on_disk()

Returns true if the plugin exists on disk.

bool
is_installed()

Returns true if the plugin is installed (has DB version or folder).

bool
has_core_requirement()

Returns true if the plugin requires a core version.

Details

in abstract_dto at line 38
array jsonSerialize()

Default implementation to serialize to JSON using the array representation.

Return Value

array

at line 51
__construct(string $type, string $name, string $component, string|null $rootdir, string|null $displayname, string|null $source, int|string|null $versiondisk, int|string|null $versiondb, float|int|string|null $versionrequires, array|null $dependencies, bool|null $enabled, string|null $release, array|null $supported, int|null $incompatible, string|null $status)

No description

Parameters

string $type

Plugin type (e.g., "mod", "auth", "local")

string $name

Plugin name (e.g., "forum", "oauth2")

string $component

Full frankenstyle name (e.g., "mod_forum")

string|null $rootdir

Full filesystem path to the plugin directory

string|null $displayname

Localized display name

string|null $source

Plugin source (STANDARD or EXTENSION)

int|string|null $versiondisk

Version declared in version.php

int|string|null $versiondb

Version installed in database

float|int|string|null $versionrequires

Moodle version required

array|null $dependencies

List of required plugins

bool|null $enabled

Whether plugin is enabled

string|null $release

Human-readable release information

array|null $supported

Supported Moodle branches

int|null $incompatible

First incompatible Moodle branch

string|null $status

Plugin status (uptodate, new, missing, etc.)

at line 72
string __toString()

String representation (component name).

Return Value

string

at line 82
array to_array()

Convert to associative array with key metadata.

Return Value

array

at line 97
stdClass to_object()

Convert to stdClass for compatibility layers.

Return Value

stdClass

at line 110
bool exists_on_disk()

Returns true if the plugin exists on disk.

Return Value

bool

at line 118
bool is_installed()

Returns true if the plugin is installed (has DB version or folder).

Return Value

bool

at line 126
bool has_core_requirement()

Returns true if the plugin requires a core version.

Return Value

bool