ynh_extension_meeo/actions/AbsencesAction.php

32 lines
790 B
PHP
Raw Normal View History

2024-07-04 05:32:34 +00:00
<?php
use YesWiki\Core\YesWikiAction;
2024-07-04 07:01:12 +00:00
use YesWiki\Bazar\Service\EntryManager;
2024-07-04 05:32:34 +00:00
class AbsencesAction extends YesWikiAction
{
public function formatArguments($arg)
{
return [];
}
public function run()
{
2024-07-04 07:01:12 +00:00
$entryManager = $this->getService(EntryManager::class);
$entries = $entryManager->search(['formsIds' => '6']);
$grouped_entries = [];
foreach ($entries as $entry) {
$identifier = $entry['listefiche5bf_eleve'];
if (!isset($grouped_entries[$identifier])) {
$grouped_entries[$identifier] = [];
}
$grouped_entries[$identifier][] = $entry;
}
return $this->render('@meeo/absences.twig', [
"groups" => $grouped_entries,
]);
2024-07-04 05:32:34 +00:00
}
}