|
@@ 534-543 (lines=10) @@
|
| 531 |
|
// je les classe par date de publication (date comme clé dans le tableau afin de pouvoir merger les objets |
| 532 |
|
// de type article avec le même procédé en les classant naturellement par date asc ou desc |
| 533 |
|
$arrayGames = array(); |
| 534 |
|
foreach ($games as $game) { |
| 535 |
|
if ($game->getPublicationDate()) { |
| 536 |
|
$key = $game->getPublicationDate()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 537 |
|
} elseif ($game->getStartDate()) { |
| 538 |
|
$key = $game->getStartDate()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 539 |
|
} else { |
| 540 |
|
$key = $game->getUpdatedAt()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 541 |
|
} |
| 542 |
|
$arrayGames[$key] = $game; |
| 543 |
|
} |
| 544 |
|
|
| 545 |
|
return $arrayGames; |
| 546 |
|
} |
|
@@ 699-708 (lines=10) @@
|
| 696 |
|
// je les classe par date de publication (date comme clé dans le tableau afin de pouvoir merger les objets |
| 697 |
|
// de type article avec le même procédé en les classant naturellement par date asc ou desc |
| 698 |
|
$arrayGames = array(); |
| 699 |
|
foreach ($games as $game) { |
| 700 |
|
if ($game->getPublicationDate()) { |
| 701 |
|
$key = $game->getPublicationDate()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 702 |
|
} elseif ($game->getStartDate()) { |
| 703 |
|
$key = $game->getStartDate()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 704 |
|
} else { |
| 705 |
|
$key = $game->getUpdatedAt()->format('Ymd') . $game->getUpdatedAt()->format('Ymd') . '-' . $game->getId(); |
| 706 |
|
} |
| 707 |
|
$arrayGames[$key] = $game; |
| 708 |
|
} |
| 709 |
|
|
| 710 |
|
return $arrayGames; |
| 711 |
|
} |