This commit is contained in:
2022-04-11 17:12:59 +02:00
parent bb65909bfa
commit 9765bc5663
3 changed files with 86 additions and 82 deletions

View File

@@ -15,7 +15,6 @@ use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityPresence;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\Scope;
@@ -84,7 +83,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
{
$rsm = new ResultSetMappingBuilder($this->em);
$sql = "
$sql = '
SELECT
a.id AS activity_id,
date,
@@ -118,7 +117,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
WHERE accompanyingperiod_id = ?
ORDER BY a.date DESC, a.id DESC
LIMIT ?
";
';
$rsm
->addEntityResult(Activity::class, 'a')
@@ -133,7 +132,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
->addFieldResult('location', 'phonenumber1', 'phonenumber1')
->addFieldResult('location', 'phonenumber2', 'phonenumber2')
->addFieldResult('location', 'email', 'email')
->addJoinedEntityResult(LocationType::class,'locationType', 'location', 'locationType' )
->addJoinedEntityResult(LocationType::class, 'locationType', 'location', 'locationType')
->addFieldResult('locationType', 'locationtype_id', 'id')
->addFieldResult('locationType', 'locationtype_title', 'title')
->addJoinedEntityResult(ActivityType::class, 'activityType', 'a', 'activityType')
@@ -151,8 +150,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
->addScalarResult('socialactionids', 'socialActionIds', Types::JSON)
->addScalarResult('socialissueids', 'socialIssueIds', Types::JSON)
->addScalarResult('durationtimeminute', 'durationTimeMinute', Types::INTEGER)
->addScalarResult('traveltimeminute', 'travelTimeMinute', Types::INTEGER)
;
->addScalarResult('traveltimeminute', 'travelTimeMinute', Types::INTEGER);
$nq = $this->em->createNativeQuery($sql, $rsm);

View File

@@ -26,10 +26,6 @@ interface ActivityACLAwareRepositoryInterface
*
* The aim of this method is to get a long list of activities and keep performance.
*
* @param AccompanyingPeriod $period
* @param string $role
* @param int|null $limit
* @param array|null $orderBy
* @return array an array of array, each item representing an activity
*/
public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array;