File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 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
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 = [];
You can’t perform that action at this time.
0 commit comments