Model extends Component
Handles models.
Table of Contents
- __construct() : mixed
- Class constructor.
- get_cache_group() : string
- Gets cache group.
- get_field_name() : string
- Gets field name.
- get_model_name() : string
- Gets model name.
- get_model_object() : object
- Gets model object.
- boot() : mixed
- Bootstraps component properties.
- set_callbacks() : mixed
- Sets the action and filter callbacks.
- set_property() : mixed
- Sets a property value.
Methods
__construct()
Class constructor.
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
Component arguments.
Return values
mixed —get_cache_group()
Gets cache group.
public
get_cache_group(string $type, string $alias) : string
Parameters
- $type : string
-
Model type.
- $alias : string
-
Model alias.
Return values
string —get_field_name()
Gets field name.
public
get_field_name(string $model, string $type, string $alias[, int $id = null ]) : string
Parameters
- $model : string
-
Model name.
- $type : string
-
Field type.
- $alias : string
-
Field alias.
- $id : int = null
-
Object ID.
Return values
string —get_model_name()
Gets model name.
public
get_model_name(string $type, string $alias) : string
Parameters
- $type : string
-
Model type.
- $alias : string
-
Model alias.
Return values
string —get_model_object()
Gets model object.
public
get_model_object(string $model, int $id) : object
Parameters
- $model : string
-
Model name.
- $id : int
-
Object ID.
Return values
object —boot()
Bootstraps component properties.
protected
boot() : mixed
Return values
mixed —set_callbacks()
Sets the action and filter callbacks.
protected
final set_callbacks(array<string|int, mixed> $callbacks) : mixed
Parameters
- $callbacks : array<string|int, mixed>
-
Callback arguments.
Return values
mixed —set_property()
Sets a property value.
protected
final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
- $name : string
-
Property name.
- $value : mixed
-
Property value.
- $prefix : string = ''
-
Method prefix.