mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Injection firstPerson in doc
This commit is contained in:
parent
176b68417a
commit
026ac91e69
@ -54,9 +54,20 @@ class HouseholdMemberSelectionContext implements DocGeneratorContextInterface
|
|||||||
*/
|
*/
|
||||||
public function getData($entity): array {
|
public function getData($entity): array {
|
||||||
$datas = array(
|
$datas = array(
|
||||||
'setValue' => array(),
|
'setValues' => array(),
|
||||||
'cloneRowAndSetValues' => array()
|
'cloneRowAndSetValues' => array()
|
||||||
); // TODO CREER UNE CLASSE POUR CA
|
);
|
||||||
|
|
||||||
|
$persons = $entity->getAccompanyingPeriodWork()->getPersons();
|
||||||
|
|
||||||
|
if(sizeof($persons) > 0) {
|
||||||
|
$firstPerson = $persons[0];
|
||||||
|
|
||||||
|
$datas['setValues'][] = array(
|
||||||
|
'firstPersonFirstName' => $firstPerson->getFirstName(),
|
||||||
|
'firstPersonLastName' => $firstPerson->getLastName(),);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(get_class($entity) == AccompanyingPeriodWorkEvaluation::class) {
|
if(get_class($entity) == AccompanyingPeriodWorkEvaluation::class) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
@ -80,7 +80,10 @@ class DocGeneratorTemplateController extends AbstractController
|
|||||||
|
|
||||||
$templateProcessor = new TemplateProcessor($tmpfname);
|
$templateProcessor = new TemplateProcessor($tmpfname);
|
||||||
|
|
||||||
// TODO foreach ($datas['setValue'] as $key => $value) {
|
foreach ($datas['setValues'] as $setValuesConf) {
|
||||||
|
$templateProcessor->setValues($setValuesConf);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($datas['cloneRowAndSetValues'] as $cloneRowAndSetValues) {
|
foreach ($datas['cloneRowAndSetValues'] as $cloneRowAndSetValues) {
|
||||||
$templateProcessor->cloneRowAndSetValues($cloneRowAndSetValues[0], $cloneRowAndSetValues[1]);
|
$templateProcessor->cloneRowAndSetValues($cloneRowAndSetValues[0], $cloneRowAndSetValues[1]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user