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

View File

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

View File

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

View File

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