Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit aaa00e4

Browse files
authored
Merge pull request #244 from LexicForLXD/fix/diverses
Fix/diverses
2 parents f7eb28d + bfc8232 commit aaa00e4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/AppBundle/Controller/BackupController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,10 @@ public function storeBackupAction(Request $request, EntityManagerInterface $em,
335335
* @throws ElementNotFoundException
336336
* @return Response
337337
*/
338-
public function getBackupsFromSchedule($scheduleId, EntityManagerInterface $em)
338+
public function getBackupsFromSchedule(Request $request, $scheduleId, EntityManagerInterface $em)
339339
{
340+
$count = $request->query->get('count');
341+
340342
$backupSchedule = $this->getDoctrine()->getRepository(BackupSchedule::class)->find($scheduleId);
341343

342344
if (!$backupSchedule) {
@@ -352,6 +354,9 @@ public function getBackupsFromSchedule($scheduleId, EntityManagerInterface $em)
352354
'No Backups for schedule ' . $scheduleId . ' found'
353355
);
354356
}
357+
if ($count) {
358+
$backups = array_slice($backups, 0, $count);
359+
}
355360

356361
$serializer = $this->get('jms_serializer');
357362
$response = $serializer->serialize($backups, 'json');

0 commit comments

Comments
 (0)