public static function loadMessagesFromDb($category, $language)
    {
        $mainQuery = new Query();
        $mainQuery->select(['t1.message', 't2.translation'])
            ->from([I18nMessage::tableName().' t1', I18nTranslation::tableName().' t2'])
            ->where('t1.message_id = t2.message_id AND t1.category = :category AND t2.language = :language')
            ->params([':category' => $category, ':language' => $language]);
        
        $messages = $mainQuery->createCommand()->queryAll();
        
        return ArrayHelper::map($messages, 'message', 'translation');
    }
public static function loadMessagesFromDb($category, $language)
    {
        $mainQuery = new Query();
        $mainQuery->select(['t1.message', 't2.translation'])
            ->from([I18nMessage::tableName().' t1', I18nTranslation::tableName().' t2'])
            ->where('t1.message_id = t2.message_id AND t1.category = :category AND t2.language = :language')
            ->params([':category' => $category, ':language' => $language]);
        
        $messages = $mainQuery->createCommand()->queryAll();
        
        return ArrayHelper::map($messages, 'message', 'translation');
    }
public static function loadMessagesFromDb ( $ category , $ language ) { $ mainQuery = new Query ( ) ; $ mainQuery -> select ( [ 't1.message' , 't2.translation' ] ) -> from ( [ I18nMessage :: tableName ( ) . ' t1' , I18nTranslation :: tableName ( ) . ' t2' ] ) -> where ( 't1.message_id = t2.message_id AND t1.category = :category AND t2.language = :language' ) -> params ( [ ':category' => $ category , ':language' => $ language ] ) ; $ messages = $ mainQuery -> createCommand ( ) -> queryAll ( ) ; return ArrayHelper :: map ( $ messages , 'message' , 'translation' ) ; }
Loads the messages from database.

@param string $category the message category.
@param string $language the target language.
@return array the messages loaded from database.
Loads the messages from database .