deprecated_model implements deprecated_model_interface uses url_generator
AbstractYes
Base deprecated_model class for MIDDAG items.
since MIDDAG 5.0.0. Use the new architecture instead:
- Domain models: local_middag\entity\entity\item
- DTOs: local_middag\dto\item_dto
- Repositories: local_middag\repository\item_repository
- Services: local_middag\service\item\item_service
Table of Contents
Interfaces
- deprecated_model_interface
- Contract for legacy MIDDAG deprecated_model.
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'
Properties
- $id : mixed
- $timecreated : mixed
- $timemodified : mixed
- $type : mixed
- $fillable : mixed
- $table : mixed
- $table_metadata : mixed
Methods
- __clone() : mixed
- __construct() : mixed
- Constructor.
- all() : array<string|int, mixed>
- delete() : bool
- get_all_metadata() : array<string, mixed>
- get_file() : mixed
- Get file associated with the model.
- get_fileurl() : mixed
- Get file URL.
- get_items() : array<string|int, deprecated_item>
- get_meta() : mixed
- Get metadata value by key.
- get_path() : string|null
- get_records() : array<string|int, deprecated_model_interface>
- get_table() : string|null
- get_table_metadata() : string
- set_meta() : void
- Set metadata key-value pair.
- set_metas() : void
- Set multiple metadata key-value pairs.
- 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
PERPAGE
public
mixed
PERPAGE
= 50
STATUS_ACTIVE
public
mixed
STATUS_ACTIVE
= 'active'
STATUS_CANCELED
public
mixed
STATUS_CANCELED
= 'canceled'
STATUS_COMPLETED
public
mixed
STATUS_COMPLETED
= 'completed'
STATUS_DELETED
public
mixed
STATUS_DELETED
= 'deleted'
STATUS_DISABLED
public
mixed
STATUS_DISABLED
= 'disabled'
STATUS_DISAPPROVED
public
mixed
STATUS_DISAPPROVED
= 'disapproved'
STATUS_ENABLED
public
mixed
STATUS_ENABLED
= 'enabled'
STATUS_EXPIRED
public
mixed
STATUS_EXPIRED
= 'expired'
STATUS_FAILED
public
mixed
STATUS_FAILED
= 'failed'
STATUS_FINISH
public
mixed
STATUS_FINISH
= 'finish'
STATUS_INACTIVE
public
mixed
STATUS_INACTIVE
= 'inactive'
STATUS_INPROGRESS
public
mixed
STATUS_INPROGRESS
= 'inprogress'
STATUS_NEW
public
mixed
STATUS_NEW
= 'new'
STATUS_PAUSED
public
mixed
STATUS_PAUSED
= 'paused'
STATUS_PLAYED
public
mixed
STATUS_PLAYED
= 'played'
STATUS_SYNC
public
mixed
STATUS_SYNC
= 'sync'
Properties
$id
public
mixed
$id
$timecreated
public
mixed
$timecreated
= 0
$timemodified
public
mixed
$timemodified
= 0
$type
public
mixed
$type
$fillable
protected
mixed
$fillable
= []
$table
protected
mixed
$table
$table_metadata
protected
mixed
$table_metadata
Methods
__clone()
public
__clone() : mixed
__construct()
Constructor.
public
__construct([mixed $id = null ]) : mixed
Parameters
- $id : mixed = null
all()
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed>delete()
public
delete() : bool
Return values
boolget_all_metadata()
public
get_all_metadata() : array<string, mixed>
Return values
array<string, mixed>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
get_fileurl()
Get file URL.
public
static get_fileurl(mixed $file) : mixed
Parameters
- $file : mixed
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
Return values
array<string|int, deprecated_item>get_meta()
Get metadata value by key.
public
get_meta(mixed $meta_key) : mixed
Parameters
- $meta_key : mixed
Tags
get_path()
public
get_path() : string|null
Return values
string|nullget_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
Return values
array<string|int, deprecated_model_interface>get_table()
public
get_table() : string|null
Return values
string|nullget_table_metadata()
public
get_table_metadata() : string
Return values
stringset_meta()
Set metadata key-value pair.
public
set_meta(mixed $meta_key, mixed $meta_value) : void
Parameters
- $meta_key : mixed
- $meta_value : mixed
Tags
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
staticurl_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_urlwebhook_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_urlfrom_record()
protected
static from_record(stdClass $r) : static
Parameters
- $r : stdClass
Return values
staticget()
Get record by ID.
protected
get(mixed $id) : false|mixed|stdClass
Parameters
- $id : mixed
Tags
Return values
false|mixed|stdClassget_by_idnumber()
Get record by idnumber.
protected
get_by_idnumber(mixed $idnumber) : false|mixed|stdClass
Parameters
- $idnumber : mixed
Tags
Return values
false|mixed|stdClasssave()
protected
save() : mixed