public function actionDeleteFilters($typeId, $id, $returnUrl) { $discountType = DiscountType::findOne($typeId); $class = new $discountType->class(); /*** @var $class AbstractDiscountType */ $class::find()->where(['id' => $id])->one()->delete(); $this->redirect($returnUrl); }
/** * @TODO: What this function for? * @return DiscountType|null */ public static function getType() { return DiscountType::findOne(['class' => static::className()]); }