2023-07-04 06:26:01 +00:00
|
|
|
```
|
|
|
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
|
|
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
|
|
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
|
|
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
|
|
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
|
|
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
|
|
|
```
|
|
|
|
# final class Load (Details)
|
|
|
|
> namespace: **VDM\Joomla\GetBible\Database**
|
|
|
|
```uml
|
|
|
|
@startuml
|
|
|
|
class Load << (F,LightGreen) >> #Green {
|
|
|
|
# Table $table
|
|
|
|
# Model $model
|
|
|
|
# Database $load
|
|
|
|
+ __construct(Table $table, Model $model, ...)
|
|
|
|
+ value(array $keys, string $field, ...) : mixed
|
2023-07-24 16:13:46 +00:00
|
|
|
+ max(array $filter, string $field, ...) : ?int
|
|
|
|
+ count(array $filter, string $table) : ?int
|
2023-07-04 06:26:01 +00:00
|
|
|
+ item(array $keys, string $table) : ?object
|
|
|
|
+ items(array $keys, string $table) : ?array
|
|
|
|
- prefix(array $keys) : array
|
|
|
|
}
|
|
|
|
|
|
|
|
note right of Load::__construct
|
|
|
|
Constructor
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
|
|
|
|
arguments:
|
|
|
|
Table $table
|
|
|
|
Model $model
|
|
|
|
Database $load
|
|
|
|
end note
|
|
|
|
|
|
|
|
note right of Load::value
|
|
|
|
Get a value from a given table
|
|
|
|
Example: $this->value(
|
|
|
|
[
|
|
|
|
'abbreviation' => 'kjv',
|
|
|
|
'book_nr' => 62,
|
|
|
|
'chapter' => 3,
|
|
|
|
'verse' => 16
|
|
|
|
], 'value_key', 'table_name'
|
|
|
|
);
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
return: mixed
|
|
|
|
|
|
|
|
arguments:
|
|
|
|
array $keys
|
|
|
|
string $field
|
|
|
|
string $table
|
|
|
|
end note
|
|
|
|
|
|
|
|
note right of Load::max
|
2023-07-24 16:13:46 +00:00
|
|
|
Get the max value based on a filtered result from a given table
|
|
|
|
Example: $this->max(
|
2023-07-04 06:26:01 +00:00
|
|
|
[
|
|
|
|
'abbreviation' => 'kjv',
|
|
|
|
'book_nr' => 62,
|
|
|
|
'chapter' => 3,
|
|
|
|
'verse' => 16
|
|
|
|
], 'value_key', 'table_name'
|
|
|
|
);
|
|
|
|
|
|
|
|
since: 2.0.1
|
2023-07-24 16:13:46 +00:00
|
|
|
return: ?int
|
2023-07-04 06:26:01 +00:00
|
|
|
|
|
|
|
arguments:
|
2023-07-24 16:13:46 +00:00
|
|
|
array $filter
|
2023-07-04 06:26:01 +00:00
|
|
|
string $field
|
|
|
|
string $table
|
|
|
|
end note
|
|
|
|
|
2023-07-24 16:13:46 +00:00
|
|
|
note right of Load::count
|
|
|
|
Count the number of items based on filter result from a given table
|
|
|
|
Example: $this->count(
|
|
|
|
[
|
|
|
|
'abbreviation' => 'kjv',
|
|
|
|
'book_nr' => 62,
|
|
|
|
'chapter' => 3,
|
|
|
|
'verse' => 16
|
|
|
|
], 'table_name'
|
|
|
|
);
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
return: ?int
|
|
|
|
end note
|
|
|
|
|
2023-07-04 06:26:01 +00:00
|
|
|
note right of Load::item
|
|
|
|
Get values from a given table
|
|
|
|
Example: $this->item(
|
|
|
|
[
|
|
|
|
'abbriviation' => 'kjv',
|
|
|
|
'book_nr' => 62,
|
|
|
|
'chapter' => 3,
|
|
|
|
'verse' => 16
|
|
|
|
], 'table_name'
|
|
|
|
);
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
return: ?object
|
|
|
|
end note
|
|
|
|
|
|
|
|
note right of Load::items
|
|
|
|
Get values from a given table
|
|
|
|
Example: $this->items(
|
|
|
|
[
|
|
|
|
'abbriviation' => [
|
|
|
|
'operator' => 'IN',
|
|
|
|
'value' => ['kjv', 'aov']
|
|
|
|
],
|
|
|
|
'book_nr' => 62,
|
|
|
|
'chapter' => 3,
|
|
|
|
'verse' => [
|
|
|
|
'operator' => 'IN',
|
|
|
|
'value' => [16, 17, 18]
|
|
|
|
]
|
|
|
|
], 'table_name'
|
|
|
|
);
|
|
|
|
Example: $this->items($ids, 'table_name');
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
return: ?array
|
|
|
|
end note
|
|
|
|
|
|
|
|
note right of Load::prefix
|
|
|
|
Add prefix to the keys
|
|
|
|
|
|
|
|
since: 2.0.1
|
|
|
|
return: array
|
|
|
|
end note
|
|
|
|
|
|
|
|
@enduml
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
```
|
|
|
|
██╗ ██████╗██████╗
|
|
|
|
██║██╔════╝██╔══██╗
|
|
|
|
██║██║ ██████╔╝
|
|
|
|
██ ██║██║ ██╔══██╗
|
|
|
|
╚█████╔╝╚██████╗██████╔╝
|
|
|
|
╚════╝ ╚═════╝╚═════╝
|
|
|
|
```
|
|
|
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
|
|
|
|