/** * @inheritdoc */ public function afterDelete() { // remove all messages settings Msetting::deleteAll('clients_or_webs_id = :clients_or_webs_id AND belong_to = :belong_to', [':clients_or_webs_id' => $this->id, ':belong_to' => 1]); Csetting::deleteAll('clients_or_webs_id = :clients_or_webs_id AND belong_to = :belong_to', [':clients_or_webs_id' => $this->id, ':belong_to' => 1]); GroupClient::deleteAll('clients_id = :clients_id', [':clients_id' => $this->id]); return parent::afterDelete(); }
public function getCsettings() { return $this->hasMany(Csetting::className(), ['checklists_id' => 'checklists_id']); }
<!-- Reminder Title --> <div class="block-title"> <h2><i class="fa fa-bell"></i> Reminders</h2> </div> <!-- END Reminder Title --> <span class="help-block">Send reminder messages to inform the sysadmin about the maturity of associated checklists.</span> <!-- Reminder Content --> <div class="form-horizontal form-bordered" id="checklists-settings"> <?php $checklists = Checklist::getChecklistBelong($belong_to); foreach ($checklists as $key => $checklist) { if (!empty($checklist->cschedule)) { $checked = FALSE; $csetting = Csetting::find()->where(['clients_or_webs_id' => $idcow, 'belong_to' => $belong_to, 'checklists_id' => $checklist->id])->one(); if (isset($csetting)) { $checked = TRUE; } ?> <div class="form-group"> <label class="col-md-6 control-label"><?php echo $checklist->title; ?> </label> <div class="col-md-6"> <label class="switch switch-primary"> <input type="checkbox" id="product-status" name="product-status" class="switch-action" <?php if ($checked) { echo 'checked';