當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Comment::deleteAll方法代碼示例

本文整理匯總了PHP中common\models\Comment::deleteAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Comment::deleteAll方法的具體用法?PHP Comment::deleteAll怎麽用?PHP Comment::deleteAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在common\models\Comment的用法示例。


在下文中一共展示了Comment::deleteAll方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterDelete

 /**
  * @inheritdoc
  */
 public function afterDelete()
 {
     Tagging::deleteAll(['taggable_type' => Tagging::TAGGABLE_VIDEO, 'taggable_id' => $this->id]);
     Relation::deleteAll(['relationable_type' => Relation::RELATIONABLE_VIDEO, 'relationable_id' => $this->id]);
     Comment::deleteAll(['commentable_type' => Comment::COMMENTABLE_VIDEO, 'commentable_id' => $this->id]);
     CommentCount::deleteAll(['commentable_type' => CommentCount::COMMENTABLE_VIDEO, 'commentable_id' => $this->id]);
     $assets = Asset::find()->where(['assetable_type' => Asset::ASSETABLE_VIDEO, 'assetable_id' => $this->id])->orWhere(['assetable_type' => Asset::ASSETABLE_VIDEOFILE, 'assetable_id' => $this->id])->all();
     foreach ($assets as $asset) {
         $asset->delete();
     }
 }
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:14,代碼來源:VideoPost.php

示例2: actionDeletePost

 public function actionDeletePost()
 {
     $selection = (array) Yii::$app->request->post('selection');
     foreach ($selection as $id) {
         Post::deleteAll(['id' => $id]);
         Like::deleteAll(['post_id' => $id]);
         Comment::deleteAll(['post_id' => $id]);
         PostTag::deleteAll(['post_id' => $id]);
         PostNotification::deleteAll(['post_id' => $id]);
         PostProtected::deleteAll(['post_id' => $id]);
     }
     return $this->render('post-manage');
 }
開發者ID:ockor,項目名稱:yii2adv-blog,代碼行數:13,代碼來源:AdminController.php

示例3: actionDelete

 public function actionDelete()
 {
     if (Yii::$app->user->isGuest) {
         $this->redirect(Url::to(['/site/login']));
     }
     if (isset($_POST['id'])) {
         $id = $_POST['id'];
         Post::findOne(['id' => $id])->delete();
         Like::deleteAll(['post_id' => $id]);
         Comment::deleteAll(['post_id' => $id]);
         PostTag::deleteAll(['post_id' => $id]);
         PostNotification::deleteAll(['post_id' => $id]);
         PostProtected::deleteAll(['post_id' => $id]);
     }
 }
開發者ID:ockor,項目名稱:yii2adv-blog,代碼行數:15,代碼來源:PostController.php

示例4: afterDelete

 /**
  * @inheritdoc
  */
 public function afterDelete()
 {
     Relation::deleteAll(['parent_id' => $this->id]);
     Comment::deleteAll(['commentable_type' => Comment::COMMENTABLE_MATCH, 'commentable_id' => $this->id]);
     CommentCount::deleteAll(['commentable_type' => CommentCount::COMMENTABLE_MATCH, 'commentable_id' => $this->id]);
 }
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:9,代碼來源:Match.php

示例5: afterDelete

 /**
  * @inheritdoc
  */
 public function afterDelete()
 {
     Comment::deleteAll(['commentable_type' => Comment::COMMENTABLE_PHOTO, 'commentable_id' => $this->id]);
     CommentCount::deleteAll(['commentable_type' => CommentCount::COMMENTABLE_PHOTO, 'commentable_id' => $this->id]);
 }
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:8,代碼來源:Asset.php

示例6: afterDelete

 public function afterDelete()
 {
     parent::afterDelete();
     Comment::deleteAll('post_id=' . $this->id);
     Tag::updateFrequency($this->tags, '');
 }
開發者ID:abwxwx,項目名稱:yiistudy,代碼行數:6,代碼來源:Post.php

示例7: actionDelete

 /**
  * Deletes an existing Post model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $model = $this->findModel($id);
     Comment::deleteAll(['post_id' => $id]);
     $model->unlinkAll('categories', true);
     $model->delete();
     return $this->redirect(['index']);
 }
開發者ID:viktornord,項目名稱:gh-php-blog,代碼行數:14,代碼來源:PostController.php

示例8: actionDelete

 /**
  * Deletes an existing User model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     Comment::deleteAll(['author_id' => $id]);
     $this->findModel($id)->delete();
     return $this->redirect(['index']);
 }
開發者ID:viktornord,項目名稱:gh-php-blog,代碼行數:12,代碼來源:UserController.php

示例9: afterDelete

 /**
  * @inheritdoc
  */
 public function afterDelete()
 {
     $this->updateCacheBlocks();
     Tagging::deleteAll(['taggable_type' => Tagging::TAGGABLE_POST, 'taggable_id' => $this->id]);
     Relation::deleteAll(['relationable_type' => Relation::RELATIONABLE_POST, 'relationable_id' => $this->id]);
     Comment::deleteAll(['commentable_type' => Comment::COMMENTABLE_POST, 'commentable_id' => $this->id]);
     CommentCount::deleteAll(['commentable_type' => CommentCount::COMMENTABLE_POST, 'commentable_id' => $this->id]);
     SelectedBlog::deleteAll(['post_id' => $this->id]);
     $assets = Asset::find()->where(['assetable_type' => Asset::ASSETABLE_POST, 'assetable_id' => $this->id])->all();
     foreach ($assets as $asset) {
         $asset->delete();
     }
 }
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:16,代碼來源:Post.php


注:本文中的common\models\Comment::deleteAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。