예제 #1
0
파일: job.php 프로젝트: andresmaeso/neno
 /**
  * Get all the strings that needs to be translated.
  *
  * @return array
  */
 public function getTranslations()
 {
     if (empty($this->translations)) {
         /* @var $db NenoDatabaseDriverMysqlx */
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select(array('t.id', 't.content_type', 't.content_id', 't.comment'))->from('`#__neno_jobs_x_translations` AS jt')->innerJoin('`#__neno_content_element_translations` AS t ON jt.translation_id = t.id')->where('job_id = ' . $this->getId());
         $db->setQuery($query);
         $translations = $db->loadAssocList();
         $this->translations = array();
         foreach ($translations as $translation) {
             $translationOriginalText = NenoHelper::getTranslationOriginalText($translation['id'], $translation['content_type'], $translation['content_id']);
             $this->translations[$translation['id']] = array('text' => NenoHelper::splitHtmlText($translationOriginalText), 'comment' => $translation['comment']);
         }
     }
     return $this->translations;
 }