Skip to content

Commit

Permalink
refactored annotation for repository methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Lung committed Dec 12, 2023
1 parent 3af61fd commit 58c43b0
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 30 deletions.
5 changes: 3 additions & 2 deletions src/BankPayment/BankPaymentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions src/BankPayment/FioBankPaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/Event/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Participant/Guest/GuestRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Participant/Ist/IstRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/Participant/ParticipantRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Participant/Patrol/PatrolLeaderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 4 additions & 2 deletions src/Participant/Patrol/PatrolParticipantRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
7 changes: 4 additions & 3 deletions src/Participant/Troop/TroopLeaderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
namespace kissj\Participant\Troop;

use kissj\Event\Event;
use kissj\Orm\Order;
use kissj\Orm\Repository;
use kissj\Participant\ParticipantRole;
use kissj\User\User;

/**
* @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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Participant/Troop/TroopParticipantRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand Down
5 changes: 3 additions & 2 deletions src/Payment/PaymentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 4 additions & 2 deletions src/User/LoginTokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
5 changes: 4 additions & 1 deletion src/User/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 58c43b0

Please sign in to comment.