MIDDAG for Moodle

coursegroup_service extends item_service

Service responsible for business rules of course groups.

Table of Contents

Constants

FILEMANAGEROPTIONS  = ['maxbytes' => 1024, 'subdirs' => 0, 'maxfiles' => 1, 'accepted_types' => ['web_image']]
PER_PAGE  = 50
TYPE  = \local_middag\extensions\coursegroup\model\coursegroup_item::TYPE

Properties

$contextids  : mixed
$id  : mixed

Methods

all()  : array<string|int, coursegroup_item>
Returns all coursegroup items.
all_enablers()  : array<string|int, mixed>
background()  : moodle_url|string
contents()  : string
Generates HTML representation of course contents.
create()  : item_interface
Creates a new coursegroup item.
delete()  : void
Deletes a coursegroup item.
deleteurl()  : moodle_url
editurl()  : moodle_url
enrol()  : bool
find()  : null|item_interface
Returns a single coursegroup item.
find_by_type()  : array<string|int, mixed>
get_contents()  : array<int, object>
Returns course and modules contained in this group.
get_contextids()  : array<string|int, mixed>
get_course_options()  : array<int, string>
Returns list of courses available for this course group.
get_course_with_contextid_options()  : array<int, string>
Returns list of context IDs from courses.
get_coursegroup_by_courseid()  : coursegroup_item|false
get_expiration()  : int
get_facade_accessor()  : string
Return the service accessor key for this facade.
get_metadata()  : array<string|int, mixed>
get_repository()  : item_repository_interface
inprogress()  : bool
item_available()  : void
item_completed()  : bool
item_get_url()  : false|moodle_url
Returns the first accessible URL for the user.
list()  : array<string|int, mixed>
pending()  : bool
update()  : item_interface
Updates an existing course group, including the image filemanager.

Constants

FILEMANAGEROPTIONS

public array<string|int, mixed> FILEMANAGEROPTIONS = ['maxbytes' => 1024, 'subdirs' => 0, 'maxfiles' => 1, 'accepted_types' => ['web_image']]

File manager options for image uploads

TYPE

public string TYPE = \local_middag\extensions\coursegroup\model\coursegroup_item::TYPE

Logical TYPE for this entity

Properties

Methods

all_enablers()

public all_enablers() : array<string|int, mixed>
Return values
array<string|int, mixed>

delete()

Deletes a coursegroup item.

public delete(int $id) : void
Parameters
$id : int
Tags
throws
dml_exception
throws
coding_exception

deleteurl()

public deleteurl() : moodle_url
Tags
throws
moodle_exception
Return values
moodle_url

editurl()

public editurl() : moodle_url
Tags
throws
moodle_exception
Return values
moodle_url

find_by_type()

public static find_by_type(string $type) : array<string|int, mixed>
Parameters
$type : string
Return values
array<string|int, mixed>

get_contents()

Returns course and modules contained in this group.

public get_contents(coursegroup_item $item) : array<int, object>
Parameters
$item : coursegroup_item
Tags
throws
dml_exception
throws
moodle_exception
throws
coding_exception
Return values
array<int, object>

List of course and cm objects

get_contextids()

public get_contextids() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_course_options()

Returns list of courses available for this course group.

public get_course_options([int $id = 0 ]) : array<int, string>
Parameters
$id : int = 0
Tags
throws
coding_exception
throws
dml_exception
throws
moodle_exception
Return values
array<int, string>

get_course_with_contextid_options()

Returns list of context IDs from courses.

public get_course_with_contextid_options([int $id = 0 ]) : array<int, string>
Parameters
$id : int = 0
Tags
throws
coding_exception
throws
dml_exception
throws
moodle_exception
Return values
array<int, string>

get_facade_accessor()

Return the service accessor key for this facade.

public static get_facade_accessor() : string
Return values
string

get_metadata()

public static get_metadata(int $id) : array<string|int, mixed>
Parameters
$id : int
Return values
array<string|int, mixed>

inprogress()

public inprogress() : bool
Tags
throws
coding_exception
throws
moodle_exception
Return values
bool

item_completed()

public item_completed() : bool
Tags
throws
dml_exception
Return values
bool

item_get_url()

Returns the first accessible URL for the user.

public item_get_url(coursegroup_item $item) : false|moodle_url
Parameters
$item : coursegroup_item
Tags
throws
coding_exception
throws
dml_exception
throws
moodle_exception
Return values
false|moodle_url

list()

public list(mixed $current_page, mixed $page_url) : array<string|int, mixed>
Parameters
$current_page : mixed
$page_url : mixed
Return values
array<string|int, mixed>

update()

Updates an existing course group, including the image filemanager.

public update(item_dto $dto) : item_interface
Parameters
$dto : item_dto
Tags
throws
coding_exception
throws
moodle_exception
Return values
item_interface

        
On this page

Search results