PGBI/cakephp3-soft-delete

Possibility to "contain" deleted records from join table

Spriz opened this issue · 2 comments

Spriz commented

Hey!

I have a relationships with Forms belongsToMany Products - where I want to retain the joinData in the forms_products table, no probs - I just include SoftDelete on the FormsProducts model.

Although I'm having issues getting the data I want - I can do a $this->FormsProducts->find('all', ['withDeleted'])->where([........]); but I can't do a $this->Forms->find('all', ['withDeleted'])->contain(['Products' => *conditions*])

Or am I simply wrong, and not hitting the correct syntax or something alike?

PGBI commented

Sorry @Spriz for this late answer.. When you do $this->Forms->find('all', ['withDeleted'])->contain(['Products' => *conditions*]), do you get an error or just an unexpected result?

Spriz commented

I wouldn't say it's an unexpected result, just that it would be nice to have an opportunity to actually have "withDeleted" on the joins too @PGBI 😄