| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 33 | protected function iHaveProfileForUser(UserInterface $user, string $nama='Nama Profile', string $jabatan = 'Staff'): Profile |
||
| 34 | { |
||
| 35 | $em = $this->getEntityManager(); |
||
| 36 | $profile = $em->getRepository(Profile::class) |
||
| 37 | ->findOneBy([ |
||
| 38 | 'user' => $user->getId(), |
||
| 39 | ]); |
||
| 40 | if (null === $profile) { |
||
| 41 | $profile = new Profile($nama, $user); |
||
| 42 | $em->persist($profile); |
||
| 43 | $em->flush(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $profile; |
||
| 47 | } |
||
| 49 |