-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* attendees export * skip leaders * export all attendees * export others
- Loading branch information
1 parent
a072047
commit ab240b2
Showing
5 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/Model/User/Queries/Handlers/TroopsByStateQueryHandler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Model\User\Queries\Handlers; | ||
|
||
use App\Model\User\Queries\TroopsByStateQuery; | ||
use App\Model\User\Repositories\TroopRepository; | ||
use App\Model\User\Troop; | ||
use Doctrine\Common\Collections\Collection; | ||
use Symfony\Component\Messenger\Handler\MessageHandlerInterface; | ||
|
||
class TroopsByStateQueryHandler implements MessageHandlerInterface | ||
{ | ||
public function __construct(private TroopRepository $troopRepository) | ||
{ | ||
} | ||
|
||
/** | ||
* @return Collection<int, Troop> | ||
*/ | ||
public function __invoke(TroopsByStateQuery $query): Collection | ||
{ | ||
return $this->troopRepository->findByState($query->getTroopState()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Model\User\Queries; | ||
|
||
class TroopsByStateQuery | ||
{ | ||
public function __construct(private string $troopState) | ||
{ | ||
} | ||
|
||
public function getTroopState(): string | ||
{ | ||
return $this->troopState; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters