Allow to retrieve wallet statements in either direction of an accounting
This commit is contained in:
@@ -18,6 +18,22 @@ class WalletStatementRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, WalletStatement::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return WalletStatement[]
|
||||
*/
|
||||
public function findByAccounting(Accounting $accounting): array
|
||||
{
|
||||
return $this->createQueryBuilder('w')
|
||||
->join('w.transaction', 'wt', Join::WITH, 'wt.id = w.transaction')
|
||||
->where('wt.origin = :val')
|
||||
->orWhere('wt.target = :val')
|
||||
->setParameter('val', $accounting->getId())
|
||||
->orderBy('w.id', 'ASC')
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return WalletStatement[]
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user