mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
add basic context for AccompanyingPeriodWorkEvalution WIP
This commit is contained in:
@@ -64,26 +64,36 @@ class AccompanyingPeriodContext implements
|
||||
|
||||
public function adminFormReverseTransform(array $data): array
|
||||
{
|
||||
return [
|
||||
$data = [
|
||||
'mainPerson' => $data['mainPerson'],
|
||||
'person1' => $data['person1'],
|
||||
'person2' => $data['person2'],
|
||||
'category' => [
|
||||
];
|
||||
|
||||
if (array_key_exists('category', $data)) {
|
||||
$data['category'] = [
|
||||
'idInsideBundle' => $data['category']->getIdInsideBundle(),
|
||||
'bundleId' => $data['category']->getBundleId(),
|
||||
],
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function adminFormTransform(array $data): array
|
||||
{
|
||||
return [
|
||||
$data = [
|
||||
'mainPerson' => $data['mainPerson'] ?? false,
|
||||
'person1' => $data['person1'] ?? false,
|
||||
'person2' => $data['person2'] ?? false,
|
||||
'category' => array_key_exists('category', $data) ?
|
||||
$this->documentCategoryRepository->find($data['category']) : null,
|
||||
];
|
||||
|
||||
if (array_key_exists('category', $data)) {
|
||||
$data['category'] = array_key_exists('category', $data) ?
|
||||
$this->documentCategoryRepository->find($data['category']) : null;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function buildAdminForm(FormBuilderInterface $builder): void
|
||||
|
Reference in New Issue
Block a user