mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
create document from evaluation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user