diff --git a/src/7d592acd-f031-4d0f-b667-584c88ae0495/README.md b/src/7d592acd-f031-4d0f-b667-584c88ae0495/README.md index 0c8cdc6..4636309 100644 --- a/src/7d592acd-f031-4d0f-b667-584c88ae0495/README.md +++ b/src/7d592acd-f031-4d0f-b667-584c88ae0495/README.md @@ -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 diff --git a/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.php b/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.php index a336180..e3c9ab8 100644 --- a/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.php +++ b/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.php @@ -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; } } diff --git a/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.power b/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.power index 0ce5564..550ae0b 100644 --- a/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.power +++ b/src/7d592acd-f031-4d0f-b667-584c88ae0495/code.power @@ -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; } \ No newline at end of file