Пример #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;
 }
Пример #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;
 }