4
0

update 2023-08-01 09:50:06

This commit is contained in:
Robot 2023-08-01 09:50:06 +02:00
parent b397c59418
commit 15eefe8f22
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 36 additions and 4 deletions

View File

@ -13,6 +13,7 @@
class Translation << (F,LightGreen) >> #Green {
# Translations $translations
+ __construct(Load $load, Insert $insert, ...)
+ translations() : bool
+ sync(string $translation) : bool
- load(string $translation) : bool
- update() : bool
@ -30,6 +31,13 @@ note right of Translation::__construct
Translations $translations
end note
note right of Translation::translations
Update translations details
since: 2.0.1
return: bool
end note
note right of Translation::sync
Sync the target being watched

View File

@ -59,6 +59,17 @@ final class Translation extends Watcher
$this->table = 'translation';
}
/**
* Update translations details
*
* @return bool True on success
* @since 2.0.1
*/
public function translations(): bool
{
return $this->update();
}
/**
* Sync the target being watched
*
@ -170,9 +181,10 @@ final class Translation extends Watcher
}
// check if we have values to insert
$inserted = false;
if ($insert !== [])
{
$this->insert->items($insert, $this->table);
$inserted = $this->insert->items($insert, $this->table);
}
// update the local values
@ -181,7 +193,7 @@ final class Translation extends Watcher
return true;
}
return false;
return $inserted;
}
}

View File

@ -31,6 +31,17 @@
$this->table = 'translation';
}
/**
* Update translations details
*
* @return bool True on success
* @since 2.0.1
*/
public function translations(): bool
{
return $this->update();
}
/**
* Sync the target being watched
*
@ -142,9 +153,10 @@
}
// check if we have values to insert
$inserted = false;
if ($insert !== [])
{
$this->insert->items($insert, $this->table);
$inserted = $this->insert->items($insert, $this->table);
}
// update the local values
@ -153,5 +165,5 @@
return true;
}
return false;
return $inserted;
}