Example #1
0
 /**
  * Lists all Post models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PostSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     foreach ($dataProvider->models as $xjj) {
         Tag::updateFrequency('', $xjj->tags);
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Example #2
0
 /**
  * This is invoked after the record is deleted.
  */
 public function afterDelete()
 {
     parent::afterDelete();
     Comment::deleteAll('post_id = :post_id', [':post_id' => $this->id]);
     Tag::updateFrequency($this->tags, '');
 }
Example #3
0
 public function afterDelete()
 {
     parent::afterDelete();
     $Comment = new Comment();
     $Comment->deleteAll(['post_id' => $this->id]);
     $tag = new Tag();
     $tag->updateFrequency($this->tags, '');
 }
Example #4
0
 /**
  * This is invoked after the record is deleted.
  */
 public function afterDelete()
 {
     parent::afterDelete();
     Comment::deleteAll(['post_id' => $this->id, 'classify_type' => strtolower($this->getClassName())]);
     Tag::updateFrequency($this->tags, '', strtolower($this->getClassName()));
 }