mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-20 17:24:25 +00:00
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* 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.
|
|
*/
|
|
|
|
namespace Chill\PersonBundle\Service\EntityInfo;
|
|
|
|
use Chill\MainBundle\Service\EntityInfo\ViewEntityInfoProviderInterface;
|
|
|
|
class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProviderInterface
|
|
{
|
|
public function __construct(
|
|
/**
|
|
* @var AccompanyingPeriodInfoUnionQueryPartInterface[]
|
|
*/
|
|
private iterable $unions,
|
|
private AccompanyingPeriodInfoQueryBuilder $builder,
|
|
) {
|
|
}
|
|
|
|
public function getViewQuery(): string
|
|
{
|
|
return implode(
|
|
' UNION ',
|
|
array_map(
|
|
fn (AccompanyingPeriodInfoUnionQueryPartInterface $part) => $this->builder->buildQuery($part),
|
|
iterator_to_array($this->unions)
|
|
)
|
|
);
|
|
}
|
|
|
|
public function getViewName(): string
|
|
{
|
|
return 'view_chill_person_accompanying_period_info';
|
|
}
|
|
}
|