MIDDAG for Moodle

enrolment extends deprecated_item

Legacy item deprecated_model class.

Table of Contents

Constants

PERPAGE  = 50
STATUS_ACTIVE  = 'active'
STATUS_CANCELED  = 'canceled'
STATUS_COMPLETED  = 'completed'
STATUS_DELETED  = 'deleted'
STATUS_DISABLED  = 'disabled'
STATUS_DISAPPROVED  = 'disapproved'
STATUS_ENABLED  = 'enabled'
STATUS_EXPIRED  = 'expired'
STATUS_FAILED  = 'failed'
STATUS_FINISH  = 'finish'
STATUS_INACTIVE  = 'inactive'
STATUS_INPROGRESS  = 'inprogress'
STATUS_NEW  = 'new'
STATUS_PAUSED  = 'paused'
STATUS_PLAYED  = 'played'
STATUS_SYNC  = 'sync'
TYPE  = 'middag_enrolment'

Properties

$contextid  : mixed
$course_completionid  : mixed
$course_completiontime  : mixed
$course_enddate  : mixed
$course_name  : mixed
$course_startdate  : mixed
$courseid  : int
$description  : mixed
$descriptionformat  : mixed
$enrol_timecreated  : mixed
$enrol_timeend  : mixed
$enrol_timestart  : mixed
$fullname  : mixed
$guid  : mixed
$id  : mixed
$idnumber  : mixed
$parent  : mixed
$shortname  : mixed
$sortorder  : mixed
$status  : mixed
$timecreated  : mixed
$timemodified  : mixed
$type  : mixed
$user_email  : mixed
$user_fullname  : mixed
$userid  : null|int
$usermodified  : mixed
$version  : mixed
$visible  : mixed
$fillable  : mixed
$table  : mixed
$table_metadata  : mixed

Methods

__clone()  : mixed
__construct()  : mixed
Constructor.
all()  : array<string|int, mixed>
canceled()  : array<string|int, mixed>|enrolment|false|float|int|string|null
completed()  : mixed
create()  : self
delete()  : bool
delete_enrol()  : bool
deleted()  : bool
disabled()  : bool
disapproved()  : void
enabled()  : bool
expired()  : void
get_all_metadata()  : array<string, mixed>
get_completion_activities()  : mixed
get_enrol()  : mixed
get_enrol_cohorts()  : mixed
get_field_by_user()  : bool
get_file()  : mixed
Get file associated with the model.
get_fileurl()  : mixed
Get file URL.
get_grade()  : mixed
get_groups()  : mixed
get_item_or_create()  : deprecated_item
Factory method to get existing or create a new item.
get_items()  : array<string|int, deprecated_item>
get_items_by_metadata()  : array<string|int, mixed>
get_meta()  : mixed
Get metadata value by key.
get_path()  : string|null
get_records()  : array<string|int, deprecated_model_interface>
get_status()  : array<string|int, mixed>
get_table()  : string|null
get_table_metadata()  : string
get_teacher()  : false|stdClass
load()  : void
run_cleaner()  : void
set_meta()  : void
Set metadata key-value pair.
set_metas()  : void
Set multiple metadata key-value pairs.
status()  : mixed
update()  : static
Update the model with form data.
url_generator()  : moodle_url
Generate a URL based on the Symfony route name and parameters.
webhook_url_generator()  : moodle_url
Generate a webhook URL.
from_record()  : static
get()  : false|mixed|stdClass
Get record by ID.
get_by_idnumber()  : false|mixed|stdClass
Get record by idnumber.
save()  : mixed

Constants

STATUS_CANCELED

public mixed STATUS_CANCELED = 'canceled'

STATUS_COMPLETED

public mixed STATUS_COMPLETED = 'completed'

STATUS_DISAPPROVED

public mixed STATUS_DISAPPROVED = 'disapproved'

STATUS_EXPIRED

public mixed STATUS_EXPIRED = 'expired'

STATUS_INPROGRESS

public mixed STATUS_INPROGRESS = 'inprogress'

Properties

$course_completionid

public mixed $course_completionid

$course_completiontime

public mixed $course_completiontime

$course_enddate

public mixed $course_enddate

$course_startdate

public mixed $course_startdate

$enrol_timecreated

public mixed $enrol_timecreated

$enrol_timestart

public mixed $enrol_timestart

$fillable

protected mixed $fillable = ['user_fullname', 'user_email', 'course_name', 'course_startdate', 'course_enddate', 'course_completionid', 'course_completiontime', 'enrol_timecreated', 'enrol_timestart', 'enrol_timeend', 'time_canceled']

Methods

__construct()

Constructor.

public __construct([null|mixed $id = null ]) : mixed
Parameters
$id : null|mixed = null
Tags
throws
Exception

all()

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

canceled()

public static canceled(mixed $userid, mixed $courseid[, mixed $ueid = 0 ]) : array<string|int, mixed>|enrolment|false|float|int|string|null
Parameters
$userid : mixed
$courseid : mixed
$ueid : mixed = 0
Return values
array<string|int, mixed>|enrolment|false|float|int|string|null

completed()

public static completed(mixed $userid, mixed $courseid, mixed $completion) : mixed
Parameters
$userid : mixed
$courseid : mixed
$completion : mixed

create()

public static create(int|null $userid, int $courseid[, mixed $ueid = 0 ]) : self
Parameters
$userid : int|null
$courseid : int
$ueid : mixed = 0
Return values
self

delete_enrol()

public static delete_enrol(mixed $ueid) : bool
Parameters
$ueid : mixed
Tags
throws
coding_exception
throws
dml_exception
throws
moodle_exception
Return values
bool

deleted()

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

disapproved()

public static disapproved(mixed $itemid) : void
Parameters
$itemid : mixed

expired()

public static expired(mixed $itemid) : void
Parameters
$itemid : mixed

get_all_metadata()

public get_all_metadata() : array<string, mixed>
Return values
array<string, mixed>

get_completion_activities()

public static get_completion_activities(mixed $courseid, mixed $userid) : mixed
Parameters
$courseid : mixed
$userid : mixed

get_enrol()

public static get_enrol(mixed $courseid, mixed $userid) : mixed
Parameters
$courseid : mixed
$userid : mixed

get_enrol_cohorts()

public static get_enrol_cohorts(mixed $courseid, mixed $userid) : mixed
Parameters
$courseid : mixed
$userid : mixed

get_field_by_user()

public static get_field_by_user(mixed $field[, mixed $userid = false ]) : bool
Parameters
$field : mixed
$userid : mixed = false
Return values
bool

get_file()

Get file associated with the model.

public get_file(mixed $context, mixed $component, mixed $filearea[, mixed $validimage = false ]) : mixed
Parameters
$context : mixed
$component : mixed
$filearea : mixed
$validimage : mixed = false
Tags
throws
coding_exception

get_fileurl()

Get file URL.

public static get_fileurl(mixed $file) : mixed
Parameters
$file : mixed

get_grade()

public static get_grade(mixed $courseid, mixed $userid[, mixed $fields = '*' ][, mixed $itemtype = false ][, mixed $unique = false ]) : mixed
Parameters
$courseid : mixed
$userid : mixed
$fields : mixed = '*'
$itemtype : mixed = false
$unique : mixed = false

get_groups()

public static get_groups(mixed $courseid, mixed $userid) : mixed
Parameters
$courseid : mixed
$userid : mixed

get_item_or_create()

Factory method to get existing or create a new item.

public static get_item_or_create(null|int|string $contextid[, string $type = '' ]) : deprecated_item
Parameters
$contextid : null|int|string
$type : string = ''
Tags
throws
dml_exception
Return values
deprecated_item

get_items()

public get_items(mixed $searchcriteria, mixed $page, mixed &$totalcount[, mixed $sort = '' ][, mixed $includedeleted = false ][, mixed $perpage = 0 ]) : array<string|int, deprecated_item>
Parameters
$searchcriteria : mixed
$page : mixed
$totalcount : mixed
$sort : mixed = ''
$includedeleted : mixed = false
$perpage : mixed = 0
Tags
throws
coding_exception
throws
dml_exception
Return values
array<string|int, deprecated_item>

get_items_by_metadata()

public get_items_by_metadata(array<string|int, mixed> $searchcriteriaitem, array<string|int, mixed> $searchcriteriameta, int $page, int &$totalcount[, null|string $sort = '' ][, bool $includedeleted = false ][, int $perpage = 0 ]) : array<string|int, mixed>

Migrate to core\repository\item_search_repository

Parameters
$searchcriteriaitem : array<string|int, mixed>
$searchcriteriameta : array<string|int, mixed>
$page : int
$totalcount : int
$sort : null|string = ''
$includedeleted : bool = false
$perpage : int = 0
Tags
throws
coding_exception
throws
dml_exception
Return values
array<string|int, mixed>

get_meta()

Get metadata value by key.

public get_meta(mixed $meta_key) : mixed
Parameters
$meta_key : mixed
Tags
throws
dml_exception

get_records()

public get_records(mixed $searchcriteria, mixed $page, mixed &$totalcount[, mixed $sort = '' ][, mixed $perpage = 0 ]) : array<string|int, deprecated_model_interface>
Parameters
$searchcriteria : mixed
$page : mixed
$totalcount : mixed
$sort : mixed = ''
$perpage : mixed = 0
Tags
throws
coding_exception
throws
dml_exception
Return values
array<string|int, deprecated_model_interface>

get_status()

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

get_table_metadata()

public get_table_metadata() : string
Return values
string

get_teacher()

public get_teacher(mixed $courseid) : false|stdClass
Parameters
$courseid : mixed
Return values
false|stdClass

load()

public load([mixed $reload = false ]) : void
Parameters
$reload : mixed = false

run_cleaner()

public run_cleaner(mixed $object) : void
Parameters
$object : mixed

set_meta()

Set metadata key-value pair.

public set_meta(mixed $meta_key, mixed $meta_value) : void
Parameters
$meta_key : mixed
$meta_value : mixed
Tags
throws
dml_exception

set_metas()

Set multiple metadata key-value pairs.

public set_metas(array<string, mixed> $metas) : void
Parameters
$metas : array<string, mixed>

update()

Update the model with form data.

public update([array<string, mixed> $formdata = [] ]) : static
Parameters
$formdata : array<string, mixed> = []
Return values
static

url_generator()

Generate a URL based on the Symfony route name and parameters.

public static url_generator(string $route[, array<string|int, mixed> $parameters = [] ][, int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ]) : moodle_url
Parameters
$route : string
$parameters : array<string|int, mixed> = []
$referenceType : int = UrlGeneratorInterface::ABSOLUTE_PATH
Return values
moodle_url

webhook_url_generator()

Generate a webhook URL.

public static webhook_url_generator(string $route[, array<string|int, mixed> $parameters = [] ][, int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ]) : moodle_url
Parameters
$route : string
$parameters : array<string|int, mixed> = []
$referenceType : int = UrlGeneratorInterface::ABSOLUTE_PATH
Return values
moodle_url

from_record()

protected static from_record(stdClass $r) : static
Parameters
$r : stdClass
Return values
static

get()

Get record by ID.

protected get(mixed $id) : false|mixed|stdClass
Parameters
$id : mixed
Tags
throws
dml_exception
Return values
false|mixed|stdClass

get_by_idnumber()

Get record by idnumber.

protected get_by_idnumber(mixed $idnumber) : false|mixed|stdClass
Parameters
$idnumber : mixed
Tags
throws
dml_exception
Return values
false|mixed|stdClass

        
On this page

Search results