MIDDAG for Moodle

has_relations

Trait has_relations.

Provides runtime relation support for Domain models. Relations are runtime-only objects loaded by Repositories/Loaders (Lazy Load or Eager Load). They are not persisted directly to the item table.

Table of Contents

Properties

$__relations  : array<string, mixed>

Methods

__get()  : mixed
Property-style access: $item->parent.
__isset()  : bool
Check presence of a relation.
get_all_relations()  : array<string, mixed>
Get all currently loaded relations.
get_relation()  : mixed
Public accessor for relations using snake_case.
has_relation()  : bool
Returns TRUE if the relation was defined (even if value is null).

Properties

$__relations

private array<string, mixed> $__relations = []

Internal storage for loaded relations

Methods

__get()

Property-style access: $item->parent.

public __get(string $name) : mixed

Convenience wrapper for get_relation().

Parameters
$name : string

__isset()

Check presence of a relation.

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

get_all_relations()

Get all currently loaded relations.

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

get_relation()

Public accessor for relations using snake_case.

public get_relation(string $name) : mixed
Parameters
$name : string

has_relation()

Returns TRUE if the relation was defined (even if value is null).

public has_relation(string $name) : bool
Parameters
$name : string
Return values
bool

        
On this page

Search results