normalization for docgen:read: add groups and so on (wip)

This commit is contained in:
2021-12-06 13:18:59 +01:00
parent 51fd81c661
commit c4998f4ac1
15 changed files with 166 additions and 70 deletions

View File

@@ -259,7 +259,7 @@ class AccompanyingPeriod implements
* cascade={"persist", "remove"},
* orphanRemoval=true
* )
* @Groups({"read"})
* @Groups({"read", "docgen:read"})
* @ResourceDuplicateCheck(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED, "Default", "default"})
*/
private Collection $resources;
@@ -274,7 +274,7 @@ class AccompanyingPeriod implements
* joinColumns={@ORM\JoinColumn(name="accompanying_period_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="scope_id", referencedColumnName="id")}
* )
* @Groups({"read"})
* @Groups({"read", "docgen:read"})
* @Assert\Count(min=1, groups={AccompanyingPeriod::STEP_CONFIRMED}, minMessage="A course must be associated to at least one scope")
*/
private Collection $scopes;
@@ -340,6 +340,7 @@ class AccompanyingPeriod implements
$this->socialIssues = new ArrayCollection();
$this->comments = new ArrayCollection();
$this->works = new ArrayCollection();
$this->resources = new ArrayCollection();
}
/**
@@ -575,6 +576,9 @@ class AccompanyingPeriod implements
return $this->createdBy;
}
/**
* @Groups({"docgen:read"})
*/
public function getCurrentParticipations(): Collection
{
return $this->getOpenParticipations();