Skip to content

Commit 8ee5446

Browse files
committed
createAction adjust comment
1 parent e121018 commit 8ee5446

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/actions/CreateAction.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class CreateAction extends JsonApiAction
4040
* Keep it empty for disable this ability
4141
* @see https://jsonapi.org/format/#crud-creating
4242
* @example
43-
* 'allowedRelations' => [
44-
* 'author' => ['idType' => 'integer'],
45-
* 'photos' => ['idType' => 'integer', 'validator' => function($model, array $ids) {
46-
* $relatedModels = Relation::find()->where(['id' => $ids])->andWhere([additional conditions])->all();
47-
* if(count($relatedModels) < $ids) {
48-
* throw new HttpException(422, 'Invalid photos ids');
49-
* }
50-
* },
51-
* ]
43+
* 'allowedRelations' => [
44+
* 'author' => ['idType' => 'integer'],
45+
* 'photos' => ['idType' => 'integer', 'validator' => function($model, array $ids) {
46+
* $relatedModels = Relation::find()->where(['id' => $ids])->andWhere([additional conditions])->all();
47+
* if (count($relatedModels) < $ids) {
48+
* throw new HttpException(422, 'Invalid photos ids');
49+
* }
50+
* },
51+
* ]
5252
*/
5353

5454
public $allowedRelations = [];

0 commit comments

Comments
 (0)