exports: add condition with distinct alias on join clauses

This commit is contained in:
2022-09-07 19:58:38 +02:00
parent 81359877c4
commit 1dcff2f23c
49 changed files with 343 additions and 220 deletions

View File

@@ -40,11 +40,11 @@ class BySocialActionAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('socialaction', $qb->getAllAliases(), true)) {
$qb->join('activity.socialActions', 'socialaction');
if (!in_array('actsocialaction', $qb->getAllAliases(), true)) {
$qb->join('activity.socialActions', 'actsocialaction');
}
$qb->addSelect('socialaction.id AS socialaction_aggregator');
$qb->addSelect('actsocialaction.id AS socialaction_aggregator');
$groupBy = $qb->getDQLPart('groupBy');

View File

@@ -40,11 +40,11 @@ class BySocialIssueAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('socialissue', $qb->getAllAliases(), true)) {
$qb->join('activity.socialIssues', 'socialissue');
if (!in_array('actsocialissue', $qb->getAllAliases(), true)) {
$qb->join('activity.socialIssues', 'actsocialissue');
}
$qb->addSelect('socialissue.id AS socialissue_aggregator');
$qb->addSelect('actsocialissue.id AS socialissue_aggregator');
$groupBy = $qb->getDQLPart('groupBy');

View File

@@ -40,11 +40,11 @@ class ByThirdpartyAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('thirdparty', $qb->getAllAliases(), true)) {
$qb->join('activity.thirdParties', 'thirdparty');
if (!in_array('acttparty', $qb->getAllAliases(), true)) {
$qb->join('activity.thirdParties', 'acttparty');
}
$qb->addSelect('thirdparty.id AS thirdparty_aggregator');
$qb->addSelect('acttparty.id AS thirdparty_aggregator');
$groupBy = $qb->getDQLPart('groupBy');

View File

@@ -40,11 +40,11 @@ class ByUserAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('user', $qb->getAllAliases(), true)) {
$qb->join('activity.users', 'user');
if (!in_array('actusers', $qb->getAllAliases(), true)) {
$qb->join('activity.users', 'actusers');
}
$qb->addSelect('user.id AS users_aggregator');
$qb->addSelect('actusers.id AS users_aggregator');
$groupBy = $qb->getDQLPart('groupBy');

View File

@@ -40,11 +40,11 @@ class LocationTypeAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('location', $qb->getAllAliases(), true)) {
$qb->join('activity.location', 'location');
if (!in_array('actloc', $qb->getAllAliases(), true)) {
$qb->join('activity.location', 'actloc');
}
$qb->addSelect('IDENTITY(location.locationType) AS locationtype_aggregator');
$qb->addSelect('IDENTITY(actloc.locationType) AS locationtype_aggregator');
$groupBy = $qb->getDQLPart('groupBy');

View File

@@ -40,11 +40,11 @@ class UserScopeAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('user', $qb->getAllAliases(), true)) {
$qb->join('activity.user', 'user');
if (!in_array('actuser', $qb->getAllAliases(), true)) {
$qb->join('activity.user', 'actuser');
}
$qb->addSelect('IDENTITY(user.mainScope) AS userscope_aggregator');
$qb->addSelect('IDENTITY(actuser.mainScope) AS userscope_aggregator');
$groupBy = $qb->getDQLPart('groupBy');