From 58c43b068e1676445fd374c5761e6f7fb89490d4 Mon Sep 17 00:00:00 2001 From: Lung Date: Tue, 12 Dec 2023 22:23:07 +0100 Subject: [PATCH] refactored annotation for repository methods --- src/BankPayment/BankPaymentRepository.php | 5 +++-- src/BankPayment/FioBankPaymentService.php | 2 -- src/Event/EventRepository.php | 5 +++-- src/Participant/Guest/GuestRepository.php | 6 +++--- src/Participant/Ist/IstRepository.php | 6 +++--- src/Participant/ParticipantRepository.php | 4 ++-- src/Participant/Patrol/PatrolLeaderRepository.php | 6 +++--- src/Participant/Patrol/PatrolParticipantRepository.php | 6 ++++-- src/Participant/Troop/TroopLeaderRepository.php | 7 ++++--- src/Participant/Troop/TroopParticipantRepository.php | 6 +++--- src/Payment/PaymentRepository.php | 5 +++-- src/User/LoginTokenRepository.php | 6 ++++-- src/User/UserRepository.php | 5 ++++- 13 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/BankPayment/BankPaymentRepository.php b/src/BankPayment/BankPaymentRepository.php index 8bfb5173..38e64b03 100755 --- a/src/BankPayment/BankPaymentRepository.php +++ b/src/BankPayment/BankPaymentRepository.php @@ -9,9 +9,10 @@ use kissj\Orm\Repository; /** - * @method BankPayment[] findBy(mixed[] $criteria, Order[] $orders = []) - * @method BankPayment|null findOneBy(mixed[] $criteria, mixed[] $orderBy = []) + * @method BankPayment get(int $bankPaymentId) * @method BankPayment getOneBy(mixed[] $criteria) + * @method BankPayment[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method BankPayment|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class BankPaymentRepository extends Repository { diff --git a/src/BankPayment/FioBankPaymentService.php b/src/BankPayment/FioBankPaymentService.php index 8c5a84a0..1afcae39 100755 --- a/src/BankPayment/FioBankPaymentService.php +++ b/src/BankPayment/FioBankPaymentService.php @@ -62,7 +62,6 @@ public function getAndSafeFreshPaymentsFromBank(Event $event): int public function setBankPaymentPaired(int $paymentId): BankPayment { - /** @var BankPayment $bankPayment */ $bankPayment = $this->bankPaymentRepository->get($paymentId); $bankPayment->status = BankPayment::STATUS_PAIRED; $this->bankPaymentRepository->persist($bankPayment); @@ -72,7 +71,6 @@ public function setBankPaymentPaired(int $paymentId): BankPayment public function setBankPaymentUnrelated(int $paymentId): BankPayment { - /** @var BankPayment $bankPayment */ $bankPayment = $this->bankPaymentRepository->get($paymentId); $bankPayment->status = BankPayment::STATUS_UNRELATED; $this->bankPaymentRepository->persist($bankPayment); diff --git a/src/Event/EventRepository.php b/src/Event/EventRepository.php index 7eebeaca..b003da56 100755 --- a/src/Event/EventRepository.php +++ b/src/Event/EventRepository.php @@ -5,14 +5,15 @@ namespace kissj\Event; use kissj\Application\DateTimeUtils; +use kissj\Orm\Order; use kissj\Orm\Relation; use kissj\Orm\Repository; /** - * @method Event[] findBy(mixed[] $criteria) - * @method Event|null findOneBy(mixed[] $criteria) * @method Event get(int $id) * @method Event getOneBy(mixed[] $criteria) + * @method Event[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method Event|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class EventRepository extends Repository { diff --git a/src/Participant/Guest/GuestRepository.php b/src/Participant/Guest/GuestRepository.php index 5029d2b7..3dfeb2ea 100755 --- a/src/Participant/Guest/GuestRepository.php +++ b/src/Participant/Guest/GuestRepository.php @@ -4,16 +4,16 @@ namespace kissj\Participant\Guest; -use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; /** * @table participant * * @method Guest get(int $istId) - * @method Guest[] findBy(mixed[] $criteria) - * @method Guest|null findOneBy(mixed[] $criteria) * @method Guest getOneBy(mixed[] $criteria) + * @method Guest[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method Guest|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class GuestRepository extends Repository { diff --git a/src/Participant/Ist/IstRepository.php b/src/Participant/Ist/IstRepository.php index 4c8d038d..30be35da 100755 --- a/src/Participant/Ist/IstRepository.php +++ b/src/Participant/Ist/IstRepository.php @@ -4,16 +4,16 @@ namespace kissj\Participant\Ist; -use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; /** * @table participant * * @method Ist get(int $istId) - * @method Ist[] findBy(mixed[] $criteria) - * @method Ist|null findOneBy(mixed[] $criteria) * @method Ist getOneBy(mixed[] $criteria) + * @method Ist[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method Ist|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class IstRepository extends Repository { diff --git a/src/Participant/ParticipantRepository.php b/src/Participant/ParticipantRepository.php index 66550b40..34611175 100755 --- a/src/Participant/ParticipantRepository.php +++ b/src/Participant/ParticipantRepository.php @@ -16,9 +16,9 @@ /** * @method Participant get(int $participantId) - * @method Participant[] findBy(mixed[] $criteria) - * @method Participant|null findOneBy(mixed[] $criteria) * @method Participant getOneBy(mixed[] $criteria) + * @method Participant[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method Participant|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class ParticipantRepository extends Repository { diff --git a/src/Participant/Patrol/PatrolLeaderRepository.php b/src/Participant/Patrol/PatrolLeaderRepository.php index ca40a16f..0975971b 100755 --- a/src/Participant/Patrol/PatrolLeaderRepository.php +++ b/src/Participant/Patrol/PatrolLeaderRepository.php @@ -4,16 +4,16 @@ namespace kissj\Participant\Patrol; -use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; /** * @table participant * * @method PatrolLeader get(int $patrolLeaderId) - * @method PatrolLeader[] findBy(mixed[] $criteria) - * @method PatrolLeader|null findOneBy(mixed[] $criteria) * @method PatrolLeader getOneBy(mixed[] $criteria) + * @method PatrolLeader[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method PatrolLeader|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class PatrolLeaderRepository extends Repository { diff --git a/src/Participant/Patrol/PatrolParticipantRepository.php b/src/Participant/Patrol/PatrolParticipantRepository.php index ab9de2c0..caad20f1 100755 --- a/src/Participant/Patrol/PatrolParticipantRepository.php +++ b/src/Participant/Patrol/PatrolParticipantRepository.php @@ -4,14 +4,16 @@ namespace kissj\Participant\Patrol; +use kissj\Orm\Order; use kissj\Orm\Repository; /** * @table participant * - * @method PatrolParticipant[] findBy(mixed[] $criteria) - * @method PatrolParticipant|null findOneBy(mixed[] $criteria) + * @method PatrolParticipant get(int $patrolParticipantId) * @method PatrolParticipant getOneBy(mixed[] $criteria) + * @method PatrolParticipant[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method PatrolParticipant|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class PatrolParticipantRepository extends Repository { diff --git a/src/Participant/Troop/TroopLeaderRepository.php b/src/Participant/Troop/TroopLeaderRepository.php index a8bd82ec..f1d96319 100755 --- a/src/Participant/Troop/TroopLeaderRepository.php +++ b/src/Participant/Troop/TroopLeaderRepository.php @@ -5,6 +5,7 @@ namespace kissj\Participant\Troop; use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; use kissj\Participant\ParticipantRole; use kissj\User\User; @@ -12,10 +13,10 @@ /** * @table participant * - * @method TroopLeader get(int $istId) - * @method TroopLeader[] findBy(mixed[] $criteria) - * @method TroopLeader|null findOneBy(mixed[] $criteria) + * @method TroopLeader get(int $troopLeaderId) * @method TroopLeader getOneBy(mixed[] $criteria) + * @method TroopLeader[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method TroopLeader|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class TroopLeaderRepository extends Repository { diff --git a/src/Participant/Troop/TroopParticipantRepository.php b/src/Participant/Troop/TroopParticipantRepository.php index 2a0fd14c..c00f424d 100755 --- a/src/Participant/Troop/TroopParticipantRepository.php +++ b/src/Participant/Troop/TroopParticipantRepository.php @@ -5,7 +5,7 @@ namespace kissj\Participant\Troop; use kissj\Event\Event; -use kissj\Orm\Relation; +use kissj\Orm\Order; use kissj\Orm\Repository; use kissj\Participant\ParticipantRole; use kissj\User\User; @@ -14,9 +14,9 @@ * @table participant * * @method TroopParticipant get(int $istId) - * @method TroopParticipant[] findBy(mixed[] $criteria) - * @method TroopParticipant|null findOneBy(mixed[] $criteria) * @method TroopParticipant getOneBy(mixed[] $criteria) + * @method TroopParticipant[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method TroopParticipant|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class TroopParticipantRepository extends Repository { diff --git a/src/Payment/PaymentRepository.php b/src/Payment/PaymentRepository.php index 636e7b87..0f8f9f1b 100755 --- a/src/Payment/PaymentRepository.php +++ b/src/Payment/PaymentRepository.php @@ -5,13 +5,14 @@ namespace kissj\Payment; use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; /** - * @method Payment[] findBy(mixed[] $criteria) - * @method Payment|null findOneBy(mixed[] $criteria) * @method Payment get(int $paymentId) * @method Payment getOneBy(mixed[] $criteria) + * @method Payment[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method Payment|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class PaymentRepository extends Repository { diff --git a/src/User/LoginTokenRepository.php b/src/User/LoginTokenRepository.php index 71144224..db45a471 100755 --- a/src/User/LoginTokenRepository.php +++ b/src/User/LoginTokenRepository.php @@ -4,12 +4,14 @@ namespace kissj\User; +use kissj\Orm\Order; use kissj\Orm\Repository; /** - * @method LoginToken[] findBy(mixed[] $criteria) - * @method LoginToken|null findOneBy(mixed[] $criteria) + * @method LoginToken get(int $loginTokenId) * @method LoginToken getOneBy(mixed[] $criteria) + * @method LoginToken[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method LoginToken|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class LoginTokenRepository extends Repository { diff --git a/src/User/UserRepository.php b/src/User/UserRepository.php index 8a5d27ae..f00a2530 100755 --- a/src/User/UserRepository.php +++ b/src/User/UserRepository.php @@ -5,11 +5,14 @@ namespace kissj\User; use kissj\Event\Event; +use kissj\Orm\Order; use kissj\Orm\Repository; /** - * @method User|null findOneBy(mixed[] $criteria) + * @method User get(int $userId) * @method User getOneBy(mixed[] $criteria) + * @method User[] findBy(mixed[] $criteria, Order[] $orders = []) + * @method User|null findOneBy(mixed[] $criteria, Order[] $orders = []) */ class UserRepository extends Repository {