Exemplo n.º 1
0
 public function linkTopic($topicId)
 {
     $topic = Topic::findOne($topicId);
     if (!isset($topic)) {
         return false;
     }
     $out = [true, $topic];
     try {
         $model = new SourceTopic(['topic_id' => $topicId, 'source_id' => $this->id]);
         if (isset($this->topicPostProcessor)) {
             $model->postProcessor = $this->topicPostProcessor;
         }
         $out[0] = $model->save();
     } catch (\Exception $ex) {
         //  echo $ex->getMessage();
         $out[0] = false;
     }
     return $out;
 }