示例#1
0
 public function afterDelete()
 {
     FilterSets::deleteAll(['category_id' => $this->id]);
     parent::afterDelete();
 }
示例#2
0
 public function afterDelete()
 {
     $object = Object::findById($this->group->object_id);
     $staticValues = PropertyStaticValues::find()->where(['property_id' => $this->id])->all();
     foreach ($staticValues as $psv) {
         $psv->delete();
     }
     if (null !== $object) {
         if ($this->is_eav) {
             Yii::$app->db->createCommand()->delete($object->eav_table_name, ['key' => $this->key, 'property_group_id' => $this->group->id])->execute();
         }
         if ($this->is_column_type_stored) {
             Yii::$app->db->createCommand()->dropColumn($object->column_properties_table_name, $this->key)->execute();
             //                if ($object->object_class == Form::className()) {
             //                    $submissionObject = Object::getForClass(Submission::className());
             //                    Yii::$app->db->createCommand()
             //                        ->dropColumn($submissionObject->column_properties_table_name, $this->key)
             //                        ->execute();
             //                }
         }
     }
     FilterSets::deleteAll(['property_id' => $this->id]);
     parent::afterDelete();
 }