mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
exports: create workAction goalResult aggregator
This commit is contained in:
@@ -52,7 +52,7 @@ final class GoalAggregator implements AggregatorInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
public function applyOn(): string
|
||||
{
|
||||
return Declarations::SOCIAL_WORK_ACTION_TYPE;
|
||||
}
|
||||
@@ -71,16 +71,18 @@ final class GoalAggregator implements AggregatorInterface
|
||||
|
||||
$g = $this->goalRepository->find($value);
|
||||
|
||||
return $this->translatableStringHelper->localize($g->getTitle());
|
||||
return $this->translatableStringHelper->localize(
|
||||
$g->getTitle()
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
public function getQueryKeys($data): array
|
||||
{
|
||||
return ['goal_aggregator'];
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Group social work actions by goal';
|
||||
}
|
||||
|
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators;
|
||||
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class GoalResultAggregator implements AggregatorInterface
|
||||
{
|
||||
//private ResultRepository $resultRepository;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
//ResultRepository $resultRepository,
|
||||
TranslatableStringHelper $translatableStringHelper
|
||||
) {
|
||||
//$this->resultRepository = $resultRepository;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
return 'Goal and result Type';
|
||||
}
|
||||
|
||||
//$g = $this->resultRepository->find($value);
|
||||
|
||||
return
|
||||
$value
|
||||
//$this->translatableStringHelper->localize(
|
||||
// $g->getTitle()
|
||||
//)
|
||||
;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getQueryKeys($data): array
|
||||
{
|
||||
return ['goal_result_aggregator'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
// no form
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Group social work actions by goal and result';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function addRole(): ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
// TODO: Implement alterQuery() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function applyOn(): string
|
||||
{
|
||||
return Declarations::SOCIAL_WORK_ACTION_TYPE;
|
||||
}
|
||||
}
|
@@ -60,7 +60,7 @@ final class ResultAggregator implements AggregatorInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
public function applyOn(): string
|
||||
{
|
||||
return Declarations::SOCIAL_WORK_ACTION_TYPE;
|
||||
}
|
||||
@@ -77,18 +77,20 @@ final class ResultAggregator implements AggregatorInterface
|
||||
return 'Result Type';
|
||||
}
|
||||
|
||||
$g = $this->resultRepository->find($value);
|
||||
$r = $this->resultRepository->find($value);
|
||||
|
||||
return $this->translatableStringHelper->localize($g->getTitle());
|
||||
return $this->translatableStringHelper->localize(
|
||||
$r->getTitle()
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
public function getQueryKeys($data): array
|
||||
{
|
||||
return ['result_aggregator'];
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Group social work actions by result';
|
||||
}
|
||||
|
Reference in New Issue
Block a user