Beispiel #1
0
 /**
  * Returns an instance of class.
  *
  * @return OCSFAQ_BOL_CategoryDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #2
0
 public function deleteCategory($id)
 {
     if (!$id) {
         return false;
     }
     $questions = $this->findQuestionsByCategoryId($id);
     if ($questions) {
         foreach ($questions as $q) {
             $q->categoryId = 0;
             $this->questionDao->save($q);
         }
     }
     $this->categoryDao->deleteById($id);
     return true;
 }