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);
 }
예제 #2
0
 /**
  * @TODO: What this function for?
  * @return DiscountType|null
  */
 public static function getType()
 {
     return DiscountType::findOne(['class' => static::className()]);
 }