Remove as much explicit persistence from wallet as possible
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Accounting\Accounting;
|
||||
use App\Entity\Accounting\Transaction;
|
||||
use App\Entity\WalletStatement;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
@@ -64,6 +65,20 @@ class WalletStatementRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
public function findByTransaction(Transaction $transaction): ?WalletStatement
|
||||
{
|
||||
if ($transaction->getId() === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->createQueryBuilder('w')
|
||||
->andWhere('w.transaction = :val')
|
||||
->setParameter('val', $transaction)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return WalletStatement[] Returns an array of WalletStatement objects
|
||||
// */
|
||||
|
||||
Reference in New Issue
Block a user