Esempio n. 1
0
 /**
  *
  * @param int $id
  * @return QUESTIONS_BOL_Question
  */
 public function deleteQuestion($id)
 {
     $options = $this->optionDao->findByQuestionId($id);
     if (!empty($options)) {
         $optionIds = array();
         foreach ($options as $opt) {
             $this->removeOptionById($opt->id);
         }
     }
     $follows = $this->followDao->findByQuestionId($id);
     foreach ($follows as $follow) {
         $this->removeFollow($follow->userId, $follow->questionId);
     }
     $this->questionDao->deleteById($id);
     OW::getEventManager()->trigger(new OW_Event(self::EVENT_QUESTION_REMOVED, array('id' => $id)));
 }