File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2929 - remove includes from counter actions
3030
31311.3.2
32- - Add validator callback for ability to check allowedRelations for Create and Update Actions
32+ - Add validator callback for ability to check allowedRelations for Create and Update Actions
33+
34+ 1.3.3
35+ - Add support scenario for delete action
Original file line number Diff line number Diff line change 88namespace insolita \fractal \actions ;
99
1010use Yii ;
11+ use yii \base \Model ;
1112use yii \web \ForbiddenHttpException ;
1213use yii \web \ServerErrorHttpException ;
1314
@@ -20,6 +21,11 @@ class DeleteAction extends JsonApiAction
2021{
2122 use HasParentAttributes;
2223
24+ /**
25+ * @var string the scenario to be assigned to the new model before it is validated and saved.
26+ */
27+ public $ scenario = Model::SCENARIO_DEFAULT ;
28+
2329 public function init ():void
2430 {
2531 parent ::init ();
@@ -40,6 +46,7 @@ public function run($id):void
4046 throw new ForbiddenHttpException ('Update with relationships not supported yet ' );
4147 }
4248 $ model = $ this ->isParentRestrictionRequired () ? $ this ->findModelForParent ($ id ) : $ this ->findModel ($ id );
49+ $ model ->setScenario ($ this ->scenario );
4350 if ($ this ->checkAccess ) {
4451 call_user_func ($ this ->checkAccess , $ this ->id , $ model );
4552 }
You can’t perform that action at this time.
0 commit comments