Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 11845 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11845 Rev 11851
Línea 104... Línea 104...
104
                $form = new CreateFeedForm($this->adapter);
104
                $form = new CreateFeedForm($this->adapter);
105
                $questionsMapper = FeedMapper::getInstance($this->adapter);
105
                $questionsMapper = FeedMapper::getInstance($this->adapter);
106
                $questions = $questionsMapper->fetchAllByMytQuestion();
106
                $questions = $questionsMapper->fetchAllByMytQuestion();
107
                $topicMapper = TopicMapper::getInstance($this->adapter);
107
                $topicMapper = TopicMapper::getInstance($this->adapter);
108
                $topicsMapper = FeedTopicMapper::getInstance($this->adapter);
108
                $topicsMapper = FeedTopicMapper::getInstance($this->adapter);
109
                
-
 
110
                $items = [];
-
 
Línea 111... Línea 109...
111
 
109
 
112
                foreach ($questions as $question) {
-
 
113
                    $params = [
-
 
114
                        'id' => $question->uuid
-
 
115
                    ];
110
                foreach ($questions as $question) {
116
                    $topicRelationships = $topicsMapper->fetchAllByFeedId($question->id);
111
                    $topicRelationships = $topicsMapper->fetchAllByFeedId($question->id);
Línea 117... Línea 112...
117
                    $question->topics = [];
112
                    $question->topics = [];
118
 
113
 
119
                    foreach ($topicRelationships as $rel) {
114
                    foreach ($topicRelationships as $rel) {
120
                        $topic = $topicMapper->fetchOne($rel->topic_id);
115
                        $topic = $topicMapper->fetchOne($rel->topic_id);
121
                        if ($topic) {
116
                        if ($topic) {
122
                            $question->topics []= $topic;
117
                            $question->topics []= $topic;
123
                        }
-
 
124
                    }
-
 
125
 
-
 
126
                    $link_answer = $this->url()->fromRoute('my-trainer/question/answer', $params);
-
 
127
 
-
 
128
                    $item =[
-
 
129
                        'actions' => [
-
 
130
                            'link_answers' => $allowAnswer ? $link_answer : '', 
-
 
131
                        ]
-
 
132
                    ];
118
                        }
133
                    array_push($items,$item);
-
 
134
                }
-
 
Línea 135... Línea 119...
135
 
119
                    }
136
 
120
                }
137
        
121
        
138
                $viewModel = new ViewModel();
122
                $viewModel = new ViewModel();