File tree 1 file changed +9
-9
lines changed 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,15 @@ class CreateAction extends JsonApiAction
40
40
* Keep it empty for disable this ability
41
41
* @see https://jsonapi.org/format/#crud-creating
42
42
* @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
+ * ]
52
52
*/
53
53
54
54
public $ allowedRelations = [];
You can’t perform that action at this time.
0 commit comments