本文整理匯總了PHP中app\models\Event::deleteAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::deleteAll方法的具體用法?PHP Event::deleteAll怎麽用?PHP Event::deleteAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Event
的用法示例。
在下文中一共展示了Event::deleteAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeDelete
/**
* @inheritdoc
*/
public function beforeDelete()
{
if (parent::beforeDelete()) {
// Delete related Models
$this->formData->delete();
$this->ui->delete();
$this->formConfirmation->delete();
$this->formEmail->delete();
// Delete all Charts, Submissions and Files related to this form
// We use deleteAll for performance reason
FormUser::deleteAll(["form_id" => $this->id]);
FormRule::deleteAll(["form_id" => $this->id]);
FormChart::deleteAll(["form_id" => $this->id]);
FormSubmissionFile::deleteAll(["form_id" => $this->id]);
FormSubmission::deleteAll(["form_id" => $this->id]);
// Delete all Stats related to this form
Event::deleteAll(["app_id" => $this->id]);
StatsPerformance::deleteAll(["app_id" => $this->id]);
StatsSubmissions::deleteAll(["app_id" => $this->id]);
// Removes files directory (and all its content)
// of this form (if exists)
FileHelper::removeDirectory($this::FILES_DIRECTORY . DIRECTORY_SEPARATOR . $this->id);
return true;
} else {
return false;
}
}