====== TranslationService ====== **Layer:** ''Service'' · **Source:** ''lib/service/TranslationService.php:12'' (lines 12–234) ---- class TranslationService ======= Inheritance ======= //No parent, interface or trait. This is a root type.// ======= Constants (0) ======= //None.// ======= Properties (3) ======= ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ | ''private'' | ''(untyped)'' | ''$translationDao'' | | 14 | | ''private'' | ''(untyped)'' | ''$languageDao'' | | 15 | | ''private'' | ''(untyped)'' | ''$loader'' | | 16 | ======= Methods (18) ======= ^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | (undocumented) | 18 | | public | ''createTranslation()'' | (undocumented) | 25 | | public | ''updateTranslation()'' | (undocumented) | 52 | | public | ''deleteTranslation()'' | (undocumented) | 70 | | public | ''getTranslations()'' | (undocumented) | 83 | | public | ''getTranslationsByContext()'' | (undocumented) | 93 | | public | ''searchTranslations()'' | (undocumented) | 103 | | public | ''countAll()'' | (undocumented) | 113 | | public | ''countAllTranslations()'' | (undocumented) | 122 | | public | ''getAllTranslations()'' | (undocumented) | 127 | | public | ''countByContext()'' | (undocumented) | 132 | | public | ''countSearch()'' | (undocumented) | 141 | | public | ''importFromArray()'' | (undocumented) | 150 | | public | ''exportToArray()'' | (undocumented) | 185 | | public | ''getContexts()'' | (undocumented) | 195 | | public | ''regenerateCache()'' | (undocumented) | 200 | | public | ''getTranslationCount()'' | (undocumented) | 206 | | private | ''validateTranslationData()'' | (undocumented) | 216 | ======== __construct() ======== public function __construct() //lines 18–23 (6)// //Takes no parameters.// ======== createTranslation() ======== public function createTranslation(array $data): int //lines 25–50 (26)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$data'' | ''array'' | //required// | //none// | **Returns:** ''int'' ======== updateTranslation() ======== public function updateTranslation(int $id, array $data): void //lines 52–68 (17)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$id'' | ''int'' | //required// | //none// | | ''$data'' | ''array'' | //required// | //none// | **Returns:** ''void'' ======== deleteTranslation() ======== public function deleteTranslation(int $id): void //lines 70–81 (12)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$id'' | ''int'' | //required// | //none// | **Returns:** ''void'' ======== getTranslations() ======== public function getTranslations(string $langCode, int $page = 1, int $perPage = 50): array //lines 83–91 (9)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$page'' | ''int'' | ''1'' | //none// | | ''$perPage'' | ''int'' | ''50'' | //none// | **Returns:** ''array'' ======== getTranslationsByContext() ======== public function getTranslationsByContext(string $langCode, string $context, int $page = 1, int $perPage = 50): array //lines 93–101 (9)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$context'' | ''string'' | //required// | //none// | | ''$page'' | ''int'' | ''1'' | //none// | | ''$perPage'' | ''int'' | ''50'' | //none// | **Returns:** ''array'' ======== searchTranslations() ======== public function searchTranslations(string $langCode, string $query, int $page = 1, int $perPage = 50): array //lines 103–111 (9)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$query'' | ''string'' | //required// | //none// | | ''$page'' | ''int'' | ''1'' | //none// | | ''$perPage'' | ''int'' | ''50'' | //none// | **Returns:** ''array'' ======== countAll() ======== public function countAll(string $langCode): int //lines 113–120 (8)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | **Returns:** ''int'' ======== countAllTranslations() ======== public function countAllTranslations(): int //lines 122–125 (4)// //Takes no parameters.// **Returns:** ''int'' ======== getAllTranslations() ======== public function getAllTranslations(int $page = 1, int $perPage = 50): array //lines 127–130 (4)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$page'' | ''int'' | ''1'' | //none// | | ''$perPage'' | ''int'' | ''50'' | //none// | **Returns:** ''array'' ======== countByContext() ======== public function countByContext(string $langCode, string $context): int //lines 132–139 (8)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$context'' | ''string'' | //required// | //none// | **Returns:** ''int'' ======== countSearch() ======== public function countSearch(string $langCode, string $query): int //lines 141–148 (8)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$query'' | ''string'' | //required// | //none// | **Returns:** ''int'' ======== importFromArray() ======== public function importFromArray(string $langCode, array $translations): int //lines 150–183 (34)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | | ''$translations'' | ''array'' | //required// | //none// | **Returns:** ''int'' ======== exportToArray() ======== public function exportToArray(string $langCode): array //lines 185–193 (9)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | **Returns:** ''array'' ======== getContexts() ======== public function getContexts(): array //lines 195–198 (4)// //Takes no parameters.// **Returns:** ''array'' ======== regenerateCache() ======== public function regenerateCache(string $langCode): void //lines 200–204 (5)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | **Returns:** ''void'' ======== getTranslationCount() ======== public function getTranslationCount(string $langCode): int //lines 206–214 (9)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$langCode'' | ''string'' | //required// | //none// | **Returns:** ''int'' ======== validateTranslationData() ======== private function validateTranslationData(array $data): void //lines 216–233 (18)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$data'' | ''array'' | //required// | //none// | **Returns:** ''void'' ======= Imports ======= ^ Alias ^ Fully-qualified name ^ | ''ServiceException'' | [[scriptlog:lib:core:serviceexception|''Scriptlog\Core\ServiceException'']] | | ''TranslationLoader'' | [[scriptlog:lib:core:translationloader|''Scriptlog\Core\TranslationLoader'']] | | ''LanguageDao'' | [[scriptlog:lib:dao:languagedao|''Scriptlog\Dao\LanguageDao'']] | | ''TranslationDao'' | [[scriptlog:lib:dao:translationdao|''Scriptlog\Dao\TranslationDao'']] | ---- //This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//