Skip to content

Commit 2d74f86

Browse files
committed
fix ticket 1007
1 parent fb8b1a3 commit 2d74f86

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/Module/Alliance/View/Diplomatic/DiplomaticRelations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function handle(GameControllerInterface $game): void
4444
$game->setTemplateVar(
4545
'RELATIONS_IMAGE',
4646
$this->allianceRelationRenderer->render(
47-
$this->allianceRelationRepository->findAll(),
47+
$this->allianceRelationRepository->getActive(),
4848
self::GRAPH_WIDTH,
4949
self::GRAPH_HEIGHT
5050
)

src/Orm/Repository/AllianceRelationRepository.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ public function getPendingCountByAlliances(int $allianceId, int $opponentId): in
7272
->getSingleScalarResult();
7373
}
7474

75+
#[\Override]
76+
public function getActive(): array
77+
{
78+
return $this->getEntityManager()
79+
->createQuery(
80+
sprintf(
81+
'SELECT ar FROM %s ar WHERE ar.date > 0 ORDER BY ar.id ASC',
82+
AllianceRelation::class
83+
)
84+
)
85+
->getResult();
86+
}
87+
7588
#[\Override]
7689
public function getByAlliancePair(int $allianceId, int $opponentId): array
7790
{

src/Orm/Repository/AllianceRelationRepositoryInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public function truncateByAlliances(Alliance $alliance, Alliance $opponent): voi
2323

2424
public function getPendingCountByAlliances(int $allianceId, int $opponentId): int;
2525

26+
/**
27+
* @return array<AllianceRelation>
28+
*/
29+
public function getActive(): array;
30+
2631
/**
2732
* @return array<AllianceRelation>
2833
*/

0 commit comments

Comments
 (0)