| Total Complexity | 5 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class DetailsManager |
||
| 13 | { |
||
| 14 | /** @var EntityManagerInterface **/ |
||
| 15 | protected $em; |
||
| 16 | /** @var SessionInterface **/ |
||
| 17 | protected $session; |
||
| 18 | |||
| 19 | 7 | public function __construct(EntityManagerInterface $em, SessionInterface $session) |
|
| 20 | { |
||
| 21 | 7 | $this->em = $em; |
|
| 22 | 7 | $this->session = $session; |
|
| 23 | 7 | } |
|
| 24 | |||
| 25 | 7 | public function getCurrentProjectDetails(Project $project) |
|
| 26 | { |
||
| 27 | 7 | $results = $this->em->getRepository(Details::class)->findBy([ |
|
| 28 | 7 | 'project' => $project |
|
| 29 | ], [ |
||
| 30 | 7 | 'updatedAt' => 'DESC' |
|
| 31 | 7 | ], 1); |
|
| 32 | 7 | return (count($results) > 0) ? $results[0] : null; |
|
| 33 | } |
||
| 34 | |||
| 35 | 3 | public function putProjectDetails(Project $project, array $data): Details |
|
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 |