_db = $db; $this->language = $langCode; $this->setLanguage(); } /** * Create Language Array for the current language */ private function setLanguage() { $this->_db->query("SELECT * FROM system_localization ORDER BY locaId ASC"); $result = $this->_db->fetchArray(); foreach ($result as $lang) { $this->phrases[$lang['locaVarname']] = $lang['locaString_'.$this->language]; } } /** * @return array */ public function postArray() { return $this->phrases; } /** * @param $phraseName * @return mixed */ public function getPhrase($phraseName) { if (isset($this->phrases[$phraseName])) { return $this->phrases[$phraseName]; } else { return $phraseName; } } }