| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 21 | #[Route('/proj/organization', name: 'kassabok_organization')] |
||
| 22 | public function index(EntityManagerInterface $entityManager): Response |
||
| 23 | { |
||
| 24 | $this->denyAccessUnlessGranted('ROLE_USER'); |
||
| 25 | |||
| 26 | // $organizations = $entityManager->getRepository(Organization::class)->findAll(); |
||
| 27 | |||
| 28 | // // Filter organizations based on user membership (if not admin) |
||
| 29 | // if (!$this->security->isGranted('ROLE_ADMIN')) { |
||
| 30 | // $currentUser = $this->security->getUser(); |
||
| 31 | // $organizations = array_filter($organizations, function (Organization $organization) use ($currentUser) { |
||
| 32 | // return $organization->getUsers()->contains($currentUser); |
||
| 33 | // }); |
||
| 34 | // } |
||
| 35 | return $this->render('kassabok/organization/index.html.twig', [ |
||
| 36 | 'controller_name' => 'OrganizationController', |
||
| 37 | 'organizations' => $entityManager->getRepository(Organization::class)->findByUser($this->getUser()), |
||
| 38 | ]); |
||
| 41 |