From 6dae33507fd1733d353207e687aaeecc6433c748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 17 Jun 2023 13:15:54 +0200 Subject: [PATCH] RVRNEXT-43 add repository for transaction payees --- src/Repository/TransactionPayeeRepository.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/Repository/TransactionPayeeRepository.php diff --git a/src/Repository/TransactionPayeeRepository.php b/src/Repository/TransactionPayeeRepository.php new file mode 100644 index 0000000..b35320c --- /dev/null +++ b/src/Repository/TransactionPayeeRepository.php @@ -0,0 +1,23 @@ +selectFromDbById($id, TransactionPayee::class); + } + + public function getAllByTransaction(Transaction $transaction, bool $useRelations = false, array $withRelations = []): Generator + { + $select = new Select(Container::$dbConnection); + $select->where('transaction_id', '=', $transaction->getId()); + + yield from Container::$persistentDataManager->selectMultipleFromDb($select, TransactionPayee::class, $useRelations, $withRelations); + } +}