class coursegroup_service extends item_service

Service responsible for business rules of course groups.

Constants

TYPE

FILEMANAGEROPTIONS

PER_PAGE

Properties

static protected array<string,object> $resolved_instances

The resolved object instances (cached roots).

from  abstract_facade
static protected bool $cached

Indicates if resolved instances should be cached.

from  abstract_facade
$id
$contextids

Methods

static mixed
__callStatic(string $method, array $args)

Dynamically handle static method calls on the facade proxy.

static string
get_facade_accessor()

Return the service accessor key for this facade.

static object
get_facade_root()

Get the root object behind the facade.

static void
swap(object $instance)

Swap a given instance for testing or runtime overriding.

static void
clear_resolved_instance(string $name)

Clear one cached facade instance.

static void
clearresolved_instances()

Clear all cached facade instances.

static void
disable_cache()

Disable instance caching (useful for testing).

static void
enable_cache()

Enable instance caching.

static void
reset()

Reset the facade: clear cache and re-enable caching.

static object
resolve_facade_instance(string $name)

Resolve the instance from the Kernel container.

create(item_dto_interface $dto)

Creates a new coursegroup item.

update(item_dto_interface $dto)

Updates an existing course group, including the image filemanager.

void
delete(int $id)

Deletes a coursegroup item.

void
static() $\local_middag\framework\contract\domain\item_interface find(int $id)

No description

static array
get_metadata(int $id)

No description

static array
find_by_type(string $type)

No description

get_repository()

No description

item_interface|null
find(int $id)

Returns a single coursegroup item.

array
all()

Returns all coursegroup items.

array
all_enablers()

No description

moodle_url|string
background(coursegroup_item $coursegroup_item)

No description

moodle_url
editurl()

No description

moodle_url
deleteurl()

No description

array
get_contextids()

No description

int
get_expiration(coursegroup_item $item)

No description

string
contents(coursegroup_item $item)

Generates HTML representation of course contents.

array
get_contents(coursegroup_item $item)

Returns course and modules contained in this group.

bool
item_completed()

No description

false|moodle_url
item_get_url(coursegroup_item $item)

Returns the first accessible URL for the user.

void
item_available()

No description

bool
pending()

No description

bool
inprogress()

No description

bool
enrol()

No description

coursegroup_item|false
get_coursegroup_by_courseid(int $id)

No description

array
get_course_options(int $id = 0)

Returns list of courses available for this course group.

array
get_course_with_contextid_options(int $id = 0)

Returns list of context IDs from courses.

array
list($current_page, $page_url)

No description

Details

in abstract_facade at line 62
static mixed __callStatic(string $method, array $args)

Dynamically handle static method calls on the facade proxy.

Parameters

string $method
array $args

Return Value

mixed

Exceptions

BadMethodCallException
RuntimeException

in item_service at line 43
static string get_facade_accessor()

Return the service accessor key for this facade.

Return Value

string

the service ID or class name

in abstract_facade at line 94
static object get_facade_root()

Get the root object behind the facade.

Return Value

object

in abstract_facade at line 104
static void swap(object $instance)

Swap a given instance for testing or runtime overriding.

Parameters

object $instance

Return Value

void

in abstract_facade at line 118
static void clear_resolved_instance(string $name)

Clear one cached facade instance.

Parameters

string $name

Return Value

void

in abstract_facade at line 126
static void clearresolved_instances()

Clear all cached facade instances.

Return Value

void

in abstract_facade at line 134
static void disable_cache()

Disable instance caching (useful for testing).

Return Value

void

in abstract_facade at line 143
static void enable_cache()

Enable instance caching.

Return Value

void

in abstract_facade at line 151
static void reset()

Reset the facade: clear cache and re-enable caching.

Return Value

void

in abstract_facade at line 168
static protected object resolve_facade_instance(string $name)

Resolve the instance from the Kernel container.

Parameters

string $name

service identifier or class name registered in the container

Return Value

object

Exceptions

RuntimeException

at line 77
item_interface create(item_dto_interface $dto)

Creates a new coursegroup item.

Parameters

item_dto_interface $dto

Return Value

item_interface

Exceptions

moodle_exception

at line 113
item_interface update(item_dto_interface $dto)

Updates an existing course group, including the image filemanager.

Parameters

item_dto_interface $dto

Return Value

item_interface

Exceptions

coding_exception
moodle_exception

at line 192
void delete(int $id)

Deletes a coursegroup item.

Parameters

int $id

Return Value

void

Exceptions

dml_exception
coding_exception

in item_service at line 38
void static() $\local_middag\framework\contract\domain\item_interface find(int $id)

No description

Parameters

) $\local_middag\framework\contract\domain\item_interface find(int $id

Return Value

void

in item_service at line 38
static array get_metadata(int $id)

No description

Parameters

int $id

Return Value

array

in item_service at line 38
static array find_by_type(string $type)

No description

Parameters

string $type

Return Value

array

in item_service at line 38
static item_repository_interface get_repository()

No description

at line 146
item_interface|null find(int $id)

Returns a single coursegroup item.

Parameters

int $id

Return Value

item_interface|null

Exceptions

coding_exception
dml_exception

at line 171
array all()

Returns all coursegroup items.

Return Value

array

Exceptions

dml_exception
coding_exception

at line 176
array all_enablers()

No description

Return Value

array

at line 197
moodle_url|string background(coursegroup_item $coursegroup_item)

No description

Parameters

coursegroup_item $coursegroup_item

Return Value

moodle_url|string

at line 224
moodle_url editurl()

No description

Return Value

moodle_url

Exceptions

moodle_exception

at line 233
moodle_url deleteurl()

No description

Return Value

moodle_url

Exceptions

moodle_exception

at line 245
array get_contextids()

No description

Return Value

array

at line 262
int get_expiration(coursegroup_item $item)

No description

Parameters

coursegroup_item $item

Return Value

int

Exceptions

coding_exception

at line 285
string contents(coursegroup_item $item)

Generates HTML representation of course contents.

Parameters

coursegroup_item $item

Return Value

string

Exceptions

dml_exception
moodle_exception

at line 333
array get_contents(coursegroup_item $item)

Returns course and modules contained in this group.

Parameters

coursegroup_item $item

Return Value

array

List of course and cm objects

Exceptions

dml_exception
moodle_exception
coding_exception

at line 381
bool item_completed()

No description

Return Value

bool

Exceptions

dml_exception

at line 421
false|moodle_url item_get_url(coursegroup_item $item)

Returns the first accessible URL for the user.

Parameters

coursegroup_item $item

Return Value

false|moodle_url

Exceptions

coding_exception
dml_exception
moodle_exception

at line 433
void item_available()

No description

Return Value

void

at line 441
bool pending()

No description

Return Value

bool

Exceptions

dml_exception

at line 451
bool inprogress()

No description

Return Value

bool

Exceptions

coding_exception
moodle_exception

at line 465
bool enrol()

No description

Return Value

bool

at line 498
coursegroup_item|false get_coursegroup_by_courseid(int $id)

No description

Parameters

int $id

Return Value

coursegroup_item|false

Exceptions

coding_exception
dml_exception
moodle_exception

at line 529
array get_course_options(int $id = 0)

Returns list of courses available for this course group.

Parameters

int $id

Return Value

array

Exceptions

coding_exception
dml_exception
moodle_exception

at line 563
array get_course_with_contextid_options(int $id = 0)

Returns list of context IDs from courses.

Parameters

int $id

Return Value

array

Exceptions

coding_exception
dml_exception
moodle_exception

at line 577
array list($current_page, $page_url)

No description

Parameters

$current_page
$page_url

Return Value

array