update 2023-08-01 09:50:06
This commit is contained in:
parent
b397c59418
commit
15eefe8f22
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user