Exemplo n.º 1
0
 /**
  * return evaluation results of a specific page
  *
  * @param $page
  * @return array
  */
 protected function getResults($page)
 {
     $results = [];
     if (isset($page['_PAGES_OVERLAY_LANGUAGE'])) {
         $evaluation = $this->evaluationRepository->findByUidForeignAndTableName($page['_PAGES_OVERLAY_UID'], 'pages_language_overlay');
     } else {
         $evaluation = $this->evaluationRepository->findByUidForeignAndTableName((int) $page['uid'], 'pages');
     }
     if ($evaluation) {
         $results = $evaluation->getResults();
     }
     return $results;
 }
 /**
  * store the results in the db
  * @param $results
  * @param $uidForeign
  */
 protected function saveChanges($results, $uidForeign)
 {
     /**
      * @var Evaluation $evaluation
      */
     $evaluation = $this->evaluationRepository->findByUidForeignAndTableName($uidForeign, $this->tableName);
     if (!$evaluation) {
         $evaluation = GeneralUtility::makeInstance(Evaluation::class);
         $evaluation->setUidForeign($uidForeign);
         $evaluation->setTablenames($this->tableName);
     }
     $evaluation->setResults($results);
     if ($evaluation->_isNew()) {
         $this->evaluationRepository->add($evaluation);
     } else {
         $this->evaluationRepository->update($evaluation);
     }
     $this->persistenceManager->persistAll();
 }
Exemplo n.º 3
0
 public function showAction($uidForeign, $tableName = 'pages')
 {
     $evaluation = $this->evaluationRepository->findByUidForeignAndTableName($uidForeign, $tableName);
     $this->view->assign('results', $evaluation);
     return $this->view->render();
 }