db_support extends facade
Facade for local_middag\framework\support\moodle\db_support.
Tags
Table of Contents
Methods
- count_records() : int
- delete_records() : bool
- execute() : bool
- get_facade_accessor() : string
- Return the service accessor key for this facade.
- get_field() : mixed
- get_field_sql() : mixed
- get_in_or_equal() : array<string|int, mixed>
- get_record() : stdClass|null
- get_records() : array<string|int, mixed>
- get_records_menu() : array<string|int, mixed>
- get_records_sql() : array<string|int, mixed>
- get_recordset_sql() : moodle_recordset
- insert_record() : int
- record_exists() : bool
- sql_compare_text() : string
- sql_fullname() : string
- sql_like() : string
- start_delegated_transaction() : moodle_transaction
- update_record() : bool
Methods
count_records()
public
static count_records(string $table[, array<string|int, mixed> $conditions = = '[]' ]) : int
Parameters
- $table : string
- $conditions : array<string|int, mixed> = = '[]'
Return values
intdelete_records()
public
static delete_records(string $table[, array<string|int, mixed> $conditions = = '[]' ]) : bool
Parameters
- $table : string
- $conditions : array<string|int, mixed> = = '[]'
Return values
boolexecute()
public
static execute(string $sql[, array<string|int, mixed>|null $params = = 'null' ]) : bool
Parameters
- $sql : string
- $params : array<string|int, mixed>|null = = 'null'
Return values
boolget_facade_accessor()
Return the service accessor key for this facade.
public
static get_facade_accessor() : string
Return values
stringget_field()
public
static get_field(string $table, string $return, array<string|int, mixed> $conditions[, int $strictness = = 'IGNORE_MISSING' ]) : mixed
Parameters
- $table : string
- $return : string
- $conditions : array<string|int, mixed>
- $strictness : int = = 'IGNORE_MISSING'
get_field_sql()
public
static get_field_sql(string $sql[, array<string|int, mixed>|null $params = = 'null' ]) : mixed
Parameters
- $sql : string
- $params : array<string|int, mixed>|null = = 'null'
get_in_or_equal()
public
static get_in_or_equal(mixed $items[, int $type = = 'SQL_PARAMS_NAMED' ][, string $prefix = = '\'p\'' ][, bool $equal = = 'true' ][, mixed $onemptyitems = = 'false' ]) : array<string|int, mixed>
Parameters
- $items : mixed
- $type : int = = 'SQL_PARAMS_NAMED'
- $prefix : string = = '\'p\''
- $equal : bool = = 'true'
- $onemptyitems : mixed = = 'false'
Return values
array<string|int, mixed>get_record()
public
static get_record(string $table, array<string|int, mixed> $conditions[, string $fields = = '\'*\'' ][, int $strictness = = 'IGNORE_MISSING' ]) : stdClass|null
Parameters
- $table : string
- $conditions : array<string|int, mixed>
- $fields : string = = '\'*\''
- $strictness : int = = 'IGNORE_MISSING'
Return values
stdClass|nullget_records()
public
static get_records(string $table[, array<string|int, mixed> $conditions = = '[]' ][, string $sort = = '\'\'' ][, string $fields = = '\'*\'' ][, int $limitfrom = = '0' ][, int $limitnum = = '0' ]) : array<string|int, mixed>
Parameters
- $table : string
- $conditions : array<string|int, mixed> = = '[]'
- $sort : string = = '\'\''
- $fields : string = = '\'*\''
- $limitfrom : int = = '0'
- $limitnum : int = = '0'
Return values
array<string|int, mixed>get_records_menu()
public
static get_records_menu(string $table[, array<string|int, mixed> $conditions = = '[]' ][, string $sort = = '\'\'' ][, string $fields = = '\'*\'' ]) : array<string|int, mixed>
Parameters
- $table : string
- $conditions : array<string|int, mixed> = = '[]'
- $sort : string = = '\'\''
- $fields : string = = '\'*\''
Return values
array<string|int, mixed>get_records_sql()
public
static get_records_sql(string $sql[, array<string|int, mixed>|null $params = = 'null' ][, int $limitfrom = = '0' ][, int $limitnum = = '0' ]) : array<string|int, mixed>
Parameters
- $sql : string
- $params : array<string|int, mixed>|null = = 'null'
- $limitfrom : int = = '0'
- $limitnum : int = = '0'
Return values
array<string|int, mixed>get_recordset_sql()
public
static get_recordset_sql(string $sql[, array<string|int, mixed>|null $params = = 'null' ][, int $limitfrom = = '0' ][, int $limitnum = = '0' ]) : moodle_recordset
Parameters
- $sql : string
- $params : array<string|int, mixed>|null = = 'null'
- $limitfrom : int = = '0'
- $limitnum : int = = '0'
Return values
moodle_recordsetinsert_record()
public
static insert_record(string $table, stdClass $dataobject[, bool $returnid = = 'true' ][, bool $bulk = = 'false' ]) : int
Parameters
- $table : string
- $dataobject : stdClass
- $returnid : bool = = 'true'
- $bulk : bool = = 'false'
Return values
intrecord_exists()
public
static record_exists(string $table, array<string|int, mixed> $conditions) : bool
Parameters
- $table : string
- $conditions : array<string|int, mixed>
Return values
boolsql_compare_text()
public
static sql_compare_text(string $fieldname) : string
Parameters
- $fieldname : string
Return values
stringsql_fullname()
public
static sql_fullname([string $firstname = = '\'firstname\'' ][, string $lastname = = '\'lastname\'' ]) : string
Parameters
- $firstname : string = = '\'firstname\''
- $lastname : string = = '\'lastname\''
Return values
stringsql_like()
public
static sql_like(string $field, string $param[, bool $casesensitive = = 'true' ][, bool $accentsensitive = = 'true' ][, bool $notlike = = 'false' ][, string $escapechar = = '\'\\\\\'' ]) : string
Parameters
- $field : string
- $param : string
- $casesensitive : bool = = 'true'
- $accentsensitive : bool = = 'true'
- $notlike : bool = = 'false'
- $escapechar : string = = '\'\\\\\''
Return values
stringstart_delegated_transaction()
public
static start_delegated_transaction() : moodle_transaction
Return values
moodle_transactionupdate_record()
public
static update_record(string $table, stdClass $dataobject[, bool $bulk = = 'false' ]) : bool
Parameters
- $table : string
- $dataobject : stdClass
- $bulk : bool = = 'false'