portal.mkgtu.ru/common/components/applyingSteps/ApplicationApplyingStepFact...

29 lines
745 B
PHP
Raw Normal View History

2024-03-28 09:51:45 +03:00
<?php
namespace common\components\applyingSteps;
use common\components\applyingSteps\steps\FullPackageStep;
use common\components\applyingSteps\steps\interfaces\IApplyingStep;
use common\modules\abiturient\models\bachelor\BachelorApplication;
use yii\base\UserException;
class ApplicationApplyingStepFactory
{
public static function createStep(BachelorApplication $application, $name)
{
$step = null;
switch ($name) {
case ApplicationApplyingStep::STEP_FULL_PACKAGE:
$step = new FullPackageStep();
break;
default:
throw new UserException('Unknown step name');
}
$step->application = $application;
return $step;
}
}