doc store bundle: add groups and correct denormalisation

This commit is contained in:
nobohan 2022-02-24 15:22:28 +01:00
parent bf26092764
commit c073ec14c8
4 changed files with 7 additions and 3 deletions

View File

@ -47,4 +47,5 @@ class StoredObjectDenormalizer implements DenormalizerInterface {
return $type === StoredObject::class; return $type === StoredObject::class;
} }
} }

View File

@ -38,5 +38,5 @@ services:
autowire: true autowire: true
resource: '../Serializer/Normalizer/' resource: '../Serializer/Normalizer/'
tags: tags:
- { name: 'serializer.normalizer', priority: 128 } - { name: 'serializer.normalizer', priority: 16 }

View File

@ -70,9 +70,10 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
* @ORM\OneToMany( * @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWorkEvaluationDocument::class, * targetEntity=AccompanyingPeriodWorkEvaluationDocument::class,
* mappedBy="accompanyingPeriodWorkEvaluation", * mappedBy="accompanyingPeriodWorkEvaluation",
* cascade={"remove"} * cascade={"remove", "persist"}
* ) * )
* @Serializer\Groups({"read"}) * @Serializer\Groups({"read", "write"})
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
*/ */
private Collection $documents; private Collection $documents;

View File

@ -69,6 +69,8 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
* cascade={"remove"}, * cascade={"remove"},
* ) * )
* @Serializer\Groups({"read"}) * @Serializer\Groups({"read"})
* @Serializer\Groups({"write"})
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
*/ */
private ?StoredObject $storedObject = null; private ?StoredObject $storedObject = null;