mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-04 12:29:43 +00:00
refactor: Update source code based on PHP conventions.
This commit is contained in:
@@ -1,58 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers.
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* Class AccompanyingCourseMenuBuilder
|
||||
*
|
||||
* @package Chill\PersonBundle\Menu
|
||||
* @author mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
protected $translator;
|
||||
|
||||
|
||||
public function __construct(TranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return [ 'accompanyingCourse' ];
|
||||
}
|
||||
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
||||
'route' => 'chill_person_accompanying_course_index',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
]])
|
||||
->setExtras(['order' => 10]);
|
||||
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 10]);
|
||||
|
||||
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
||||
'route' => 'chill_person_accompanying_course_show',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
]])
|
||||
->setExtras(['order' => 20]);
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 20]);
|
||||
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Details'), [
|
||||
'route' => 'chill_person_accompanying_course_history',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId()
|
||||
]])
|
||||
->setExtras(['order' => 30]);
|
||||
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 30]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['accompanyingCourse'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user