php - Symfony get nested entities which are not flagged as deleted -


i programming first symfony project , stuck @ problem: have entity called "load" refers other entities call "transaction" (x transactions belongs 1 load) :

 /**  * @orm\onetomany(targetentity="transaction", mappedby="load")       *   */   private $transactions; 

the transactions can flagged deleted keep stored in database. created custom repository , methods deliver me undeleted transactions.

but if want fetch load it's transactions, call

 $load = $loadrepository->find($id); 

it supposed. fetches transactions database referenced given load.

but don't want have deleted transactions in result. how can achive this? have absolutely no approach. sure, can iterate on transactions , remove deleted ones think there better solution.

i tried register repository transactions (this works) , override find-method (this doesn't work). there method internally called , have override?

thank in advance!

if have correctly understand question, behavior exist doctrine extension softdeletable, can find documentation here

you have add deleteat property on transaction entity entities data inside field automatically filtered if deleted. if want find of transaction entities can disable filter on query.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -