Build parts to track info on accompanying period

This commit is contained in:
2023-04-18 21:16:40 +02:00
parent 7e3295c71f
commit f2e1c73f37
14 changed files with 459 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?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';
}
}