apply timelineSingleQuery on events

This commit is contained in:
Julien Fastré 2021-05-26 18:05:02 +02:00
parent 75c586fbf8
commit cad8174333
2 changed files with 8 additions and 6 deletions

View File

@ -23,6 +23,7 @@ namespace Chill\EventBundle\Timeline;
use Chill\EventBundle\Entity\Event;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Timeline\TimelineProviderInterface;
use Chill\MainBundle\Timeline\TimelineSingleQuery;
use Doctrine\ORM\EntityManager;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@ -88,13 +89,14 @@ class TimelineEventProvider implements TimelineProviderInterface
$metadataParticipation = $this->em->getClassMetadata('ChillEventBundle:Participation');
$metadataPerson = $this->em->getClassMetadata('ChillPersonBundle:Person');
$query = array(
$query = TimelineSingleQuery::fromArray([
'id' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('id'),
'type' => 'event',
'date' => $metadataEvent->getTableName().'.'.$metadataEvent->getColumnName('date'),
'FROM' => $this->getFromClause($metadataEvent, $metadataParticipation, $metadataPerson),
'WHERE' => $this->getWhereClause($metadataEvent, $metadataParticipation, $metadataPerson, $args['person'])
);
'WHERE' => $this->getWhereClause($metadataEvent, $metadataParticipation, $metadataPerson, $args['person']),
'parameters' => []
]);
return $query;
}
@ -238,4 +240,4 @@ class TimelineEventProvider implements TimelineProviderInterface
);
}
}
}

View File

@ -6,5 +6,5 @@ services:
- '@chill.main.security.authorization.helper'
- '@security.token_storage'
public: true
# tags:
# - { name: chill.timeline, context: 'person' }
tags:
- { name: chill.timeline, context: 'person' }