mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-19 08:44:24 +00:00
49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?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.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\PersonBundle\Timeline;
|
|
|
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|
|
|
/**
|
|
* Provide information for opening periods to timeline.
|
|
*/
|
|
class TimelineAccompanyingPeriodOpening extends AbstractTimelineAccompanyingPeriod
|
|
{
|
|
public function fetchQuery($context, array $args)
|
|
{
|
|
$metadata = $this->em
|
|
->getClassMetadata(AccompanyingPeriod::class);
|
|
|
|
$query = $this->basicFetchQuery($context, $args);
|
|
|
|
$query->setKey('accompanying_period_opening')
|
|
->setDate($metadata->getColumnName('openingDate'));
|
|
|
|
return $query;
|
|
}
|
|
|
|
public function getEntityTemplate($entity, $context, array $args)
|
|
{
|
|
return $this->getBasicEntityTemplate(
|
|
'ChillPersonBundle:Timeline:opening_period.html.twig',
|
|
$entity,
|
|
$context,
|
|
$args
|
|
);
|
|
}
|
|
|
|
public function supportsType($type)
|
|
{
|
|
return 'accompanying_period_opening' === $type;
|
|
}
|
|
}
|