mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
renaming aggregator job and scope for generic use
This commit is contained in:
@@ -18,7 +18,7 @@ use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ReferrerJobAggregator implements AggregatorInterface
|
||||
final class JobAggregator implements AggregatorInterface
|
||||
{
|
||||
private UserJobRepository $userJobRepository;
|
||||
|
||||
@@ -38,14 +38,14 @@ final class ReferrerJobAggregator implements AggregatorInterface
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->join('acpw.referrers', 'r');
|
||||
$qb->addSelect('IDENTITY(r.userJob) as referrer_job_aggregator');
|
||||
$qb->addSelect('IDENTITY(r.userJob) as job_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
if (!empty($groupBy)) {
|
||||
$qb->addGroupBy('referrer_job_aggregator');
|
||||
$qb->addGroupBy('job_aggregator');
|
||||
} else {
|
||||
$qb->groupBy('referrer_job_aggregator');
|
||||
$qb->groupBy('job_aggregator');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -76,7 +76,7 @@ final class ReferrerJobAggregator implements AggregatorInterface
|
||||
|
||||
public function getQueryKeys($data)
|
||||
{
|
||||
return ['referrer_job_aggregator'];
|
||||
return ['job_aggregator'];
|
||||
}
|
||||
|
||||
public function getTitle()
|
@@ -18,7 +18,7 @@ use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ReferrerScopeAggregator implements AggregatorInterface
|
||||
final class ScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private ScopeRepository $scopeRepository;
|
||||
|
||||
@@ -38,14 +38,14 @@ final class ReferrerScopeAggregator implements AggregatorInterface
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->join('acpw.referrers', 'r');
|
||||
$qb->addSelect('IDENTITY(r.mainScope) as referrer_scope_aggregator');
|
||||
$qb->addSelect('IDENTITY(r.mainScope) as scope_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
if (!empty($groupBy)) {
|
||||
$qb->addGroupBy('referrer_scope_aggregator');
|
||||
$qb->addGroupBy('scope_aggregator');
|
||||
} else {
|
||||
$qb->groupBy('referrer_scope_aggregator');
|
||||
$qb->groupBy('scope_aggregator');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -76,7 +76,7 @@ final class ReferrerScopeAggregator implements AggregatorInterface
|
||||
|
||||
public function getQueryKeys($data)
|
||||
{
|
||||
return ['referrer_scope_aggregator'];
|
||||
return ['scope_aggregator'];
|
||||
}
|
||||
|
||||
public function getTitle()
|
Reference in New Issue
Block a user