Skip to content

Commit bfe718b

Browse files
author
tchapi
committed
chore
1 parent 396ea9a commit bfe718b

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/Controller/Admin/CalendarController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use App\Entity\CalendarInstance;
77
use App\Entity\CalendarSubscription;
88
use App\Entity\Principal;
9-
use App\Entity\SchedulingObject;
109
use App\Entity\User;
1110
use App\Form\CalendarInstanceType;
1211
use Doctrine\Persistence\ManagerRegistry;

src/Repository/CalendarInstanceRepository.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
namespace App\Repository;
44

5+
use App\Entity\Calendar;
56
use App\Entity\CalendarInstance;
7+
use App\Entity\CalendarObject;
68
use App\Entity\Principal;
9+
use App\Entity\SchedulingObject;
710
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
811
use Doctrine\Persistence\ManagerRegistry;
912

@@ -37,11 +40,11 @@ public function findSharedInstancesOfInstance(int $calendarId, bool $withCalenda
3740
return $query->addSelect('p.displayName', 'p.email')
3841
->getQuery()
3942
->getArrayResult();
40-
} else {
41-
// Returns CalendarInstances as objects
42-
return $query->getQuery()
43-
->getResult();
4443
}
44+
45+
// Returns CalendarInstances as objects
46+
return $query->getQuery()
47+
->getResult();
4548
}
4649

4750
/**
@@ -76,7 +79,7 @@ public function hasDifferentOwner(int $calendarId, string $principalUri): bool
7679

7780
public function findAllSchedulingObjectsForCalendar(int $calendarId): array
7881
{
79-
$objectRepository = $this->getEntityManager()->getRepository(\App\Entity\SchedulingObject::class);
82+
$objectRepository = $this->getEntityManager()->getRepository(SchedulingObject::class);
8083

8184
return $objectRepository->createQueryBuilder('s')
8285
->leftJoin(CalendarObject::class, 'c', \Doctrine\ORM\Query\Expr\Join::WITH, 'c.uri = s.uri')
@@ -96,7 +99,7 @@ public function findAllSchedulingObjectsForCalendar(int $calendarId): array
9699
*/
97100
public function getObjectCountsByComponentType(int $calendarId): array
98101
{
99-
$objectRepository = $this->getEntityManager()->getRepository(\App\Entity\CalendarObject::class);
102+
$objectRepository = $this->getEntityManager()->getRepository(CalendarObject::class);
100103

101104
// Instead of three separate queries, get all counts in a single query
102105
$results = $objectRepository->createQueryBuilder('o')
@@ -108,9 +111,9 @@ public function getObjectCountsByComponentType(int $calendarId): array
108111
->getResult();
109112

110113
$componentTypeMap = [
111-
\App\Entity\Calendar::COMPONENT_EVENTS => 'events',
112-
\App\Entity\Calendar::COMPONENT_NOTES => 'notes',
113-
\App\Entity\Calendar::COMPONENT_TODOS => 'tasks',
114+
Calendar::COMPONENT_EVENTS => 'events',
115+
Calendar::COMPONENT_NOTES => 'notes',
116+
Calendar::COMPONENT_TODOS => 'tasks',
114117
];
115118

116119
$counts = [

0 commit comments

Comments
 (0)