Exemplo n.º 1
0
 public function _assignToDefault($categoryId)
 {
     $defaultCategory = FaqCategory::getDefault($this->getAccountId());
     $condition = ['isDeleted' => false, 'faqCategoryId' => $categoryId];
     $results = Faq::find()->where($condition)->all();
     foreach ($results as $result) {
         $result['faqCategoryId'] = $defaultCategory->_id . '';
         $result->save();
     }
 }
Exemplo n.º 2
0
 public function getQuestions()
 {
     $condition = ['isDeleted' => false, 'accountId' => $this->accountId, 'faqCategoryId' => $this->_id . ''];
     return Faq::find()->where($condition)->orderBy(['createdAt' => SORT_DESC])->all();
 }