Exemple #1
0
 /**
  * Add the Trader specific information about this Topic when requesting via the API
  *
  * @param phpbbEvent $event
  */
 public function rfd_api_get_topic(phpbbEvent $event)
 {
     $data = $event->get_data();
     $topics = $data['topics'];
     $raw_topics = $data['raw_topics'];
     for ($i = 0; $i < count($topics); $i++) {
         $raw_type = (int) $raw_topics[$i]['topic_trader_type'];
         if (empty($raw_type)) {
             $type = null;
         } else {
             $type_ary = $this->manager->getTraderStatusArray($raw_type);
             $type = $type_ary[0];
         }
         $topics[$i]['trader_type'] = $type;
     }
     $data['topics'] = $topics;
     $event->set_data($data);
 }