22
33namespace App \Repository ;
44
5+ use App \Entity \Calendar ;
56use App \Entity \CalendarInstance ;
7+ use App \Entity \CalendarObject ;
68use App \Entity \Principal ;
9+ use App \Entity \SchedulingObject ;
710use Doctrine \Bundle \DoctrineBundle \Repository \ServiceEntityRepository ;
811use 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