4
0

update 2023-06-20 15:09:48

This commit is contained in:
Robot 2023-06-20 15:09:48 +02:00
parent 32bc71fbff
commit 579f9635c2
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
4 changed files with 22 additions and 22 deletions

View File

@ -85,13 +85,13 @@ final class Load
public function value(array $keys, string $field, string $table)
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table, $field))
if ($this->table->exist($table, $field))
{
return $this->model->value(
$this->load->value(
["a.${field}" => $field],
['a' => $table],
$keys
$this->prefix($keys)
),
$field,
$table
@ -121,13 +121,13 @@ final class Load
public function item(array $keys, string $table): ?object
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table))
if ($this->table->exist($table))
{
return $this->model->item(
$this->load->item(
['all' => 'a.*'],
['a' => $table],
$keys
$this->prefix($keys)
),
$table
);
@ -163,11 +163,11 @@ final class Load
public function items(array $keys, string $table): ?array
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table))
if ($this->table->exist($table))
{
return $this->model->items(
$this->load->items(
['all' => 'a.*'], ['a' => $table], $keys
['all' => 'a.*'], ['a' => $table], $this->prefix($keys)
),
$table
);
@ -184,7 +184,7 @@ final class Load
* @return array
* @since 2.0.1
*/
private function prefix(array $keys): array
private function prefix(array &$keys): array
{
// update the key values
$bucket = [];

View File

@ -59,13 +59,13 @@
public function value(array $keys, string $field, string $table)
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table, $field))
if ($this->table->exist($table, $field))
{
return $this->model->value(
$this->load->value(
["a.${field}" => $field],
['a' => $table],
$keys
$this->prefix($keys)
),
$field,
$table
@ -95,13 +95,13 @@
public function item(array $keys, string $table): ?object
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table))
if ($this->table->exist($table))
{
return $this->model->item(
$this->load->item(
['all' => 'a.*'],
['a' => $table],
$keys
$this->prefix($keys)
),
$table
);
@ -137,11 +137,11 @@
public function items(array $keys, string $table): ?array
{
// check if this is a valid table
if ($this->prefix($keys) && $this->table->exist($table))
if ($this->table->exist($table))
{
return $this->model->items(
$this->load->items(
['all' => 'a.*'], ['a' => $table], $keys
['all' => 'a.*'], ['a' => $table], $this->prefix($keys)
),
$table
);
@ -158,7 +158,7 @@
* @return array
* @since 2.0.1
*/
private function prefix(array $keys): array
private function prefix(array &$keys): array
{
// update the key values
$bucket = [];

View File

@ -257,7 +257,7 @@ final class Watcher
{
// check local value
if (($chapter_sha = $this->load->value(
['abbreviation' => $translation, 'nr' => $book, 'chapter' => $chapter],
['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $chapter],
'sha', 'chapter'
)) !== null)
{
@ -401,13 +401,13 @@ final class Watcher
private function updateHash(string $translation, int $book, int $chapter, string $hash): bool
{
// load the chapter
if (($chapter = $this->load->value(
if (($item = $this->load->item(
['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $chapter],
'id', 'chapter'
'chapter'
)) !== null)
{
$update = [];
$update['id'] = $chapter;
$update['id'] = $item->id;
$update['sha'] = $hash;
// update the local verses

View File

@ -227,7 +227,7 @@
{
// check local value
if (($chapter_sha = $this->load->value(
['abbreviation' => $translation, 'nr' => $book, 'chapter' => $chapter],
['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $chapter],
'sha', 'chapter'
)) !== null)
{
@ -371,13 +371,13 @@
private function updateHash(string $translation, int $book, int $chapter, string $hash): bool
{
// load the chapter
if (($chapter = $this->load->value(
if (($item = $this->load->item(
['abbreviation' => $translation, 'book_nr' => $book, 'chapter' => $chapter],
'id', 'chapter'
'chapter'
)) !== null)
{
$update = [];
$update['id'] = $chapter;
$update['id'] = $item->id;
$update['sha'] = $hash;
// update the local verses