create document from evaluation

This commit is contained in:
2021-08-19 19:47:06 +02:00
parent 364346d0aa
commit a797143511
6 changed files with 106 additions and 34 deletions

View File

@@ -126,6 +126,21 @@ class AccompanyingPeriodWorkEvaluation implements TrackUpdateInterface, TrackCre
*/
private Collection $documents;
/**
* This is a workaround for client, to allow them to assign arbitrary data
* dedicated to their job.
*
* This data is not persisted into database, but will appears on the data
* normalized during the same request (like PUT/PATCH request)
*
* @Serializer\Groups({"read"})
* @Serializer\Groups({"write"})
*
* @var mixed
*
*/
private $key = null;
public function __construct()
{
$this->documents = new ArrayCollection();
@@ -187,7 +202,8 @@ class AccompanyingPeriodWorkEvaluation implements TrackUpdateInterface, TrackCre
($this->evaluation instanceof Evaluation
&& null === $evaluation)
) {
throw new \LogicException("once set, an ${self::class} cannot
$cl = AccompanyingPeriodWorkEvaluation::class;
throw new \LogicException("once set, an $cl cannot
change or remove the linked Evaluation::class");
}
@@ -366,5 +382,26 @@ class AccompanyingPeriodWorkEvaluation implements TrackUpdateInterface, TrackCre
return $this->documents;
}
/**
* Arbitrary data, used for client
*
* @return mixed
*/
public function getKey()
{
return $this->key;
}
/**
* Arbitrary data, used for client
*
* @param mixed $key
* @return AccompanyingPeriodWorkEvaluation
*/
public function setKey($key): self
{
$this->key = $key;
return $this;
}
}