Closed davidyell closed 9 years ago
If I get some time today, I'll see if I can submit a PR for this.
Indeed, that's an annoying behavior... Thanks for reporting it!
I like the idea of throwing an exception. I think it should be extended to all method and not only the hardDeleteAll()
one. Perhaps you could check if the soft delete field exists in getSoftDeleteField()
.
Yes, that's a good idea.
@davidyell are you still planning on submitting a PR, or do you want me to work on this?
Oh, so sorry I totally forgot. If you don't mind taking it on that would be great. Thanks!
On Thu, 28 May 2015 18:02 Pierre notifications@github.com wrote:
@davidyell https://github.com/davidyell are you still planning on submitting a PR, or do you want me to work on this?
Reply to this email directly or view it on GitHub https://github.com/PGBI/cakephp3-soft-delete/issues/5#issuecomment-106491016 .
No pb, i'll do it.
Setup My setup is that I have
boolean deleted
anddatetime deleted_date
.What I did Added the Trait to my table and called
hardDeleteAll()
.What happened All records in my table were deleted.
What I expected to happen I would expect no records to be deleted, or an exception to be thrown if the default field doesn't exist in the Tables schema. Perhaps something like
$entity->has($field)