19declare(strict_types=1);
44 foreach ($translations->
get() as $translation) {
46 $translations->
getId(),
47 $translation->getLanguageCode(),
48 $translation->getTranslation()
55 private function has(
string $identification,
string $language_code): bool
57 $language_identification =
"{$identification}|$language_code";
59 return $this->db->queryF(
60 'SELECT id FROM ' . self::TABLE_NAME .
' WHERE id = %s',
62 [$language_identification]
67 string $identification,
68 string $language_code,
71 $language_identification =
"{$identification}|$language_code";
72 if ($this->
has($identification, $language_code)) {
76 'translation' => [
'text', $translation],
79 'id' => [
'text', $language_identification]
86 'id' => [
'text', $language_identification],
87 'identification' => [
'text', $identification],
88 'translation' => [
'text', $translation],
89 'language_key' => [
'text', $language_code],
97 $identification = $item->
getId();
98 $r = $this->db->queryF(
99 'SELECT * FROM ' . self::TABLE_NAME .
' WHERE identification = %s',
104 while ($row = $this->db->fetchAssoc($r)) {
105 if (empty($row[
'translation'])) {
110 $row[
'identification'],
111 $row[
'language_key'],
130 $this->db->manipulate(
'TRUNCATE TABLE ' . self::TABLE_NAME);
135 $pons->
tabs()->structure()->current();
137 $id = $pons->
in()->getFirstFromRequest(
'top_id');
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
storeSingleTranslation(string $identification, string $language_code, string $translation)
retrieveCurrent(Pons $pons)
has(string $identification, string $language_code)
store(Translations $translations)
__construct(private ilDBInterface $db)
blank(TranslatableItem $item, string $language_code, string $translation)