propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 393 forks source link

Behavior hook for DELETE #1959

Open marcoas opened 1 year ago

marcoas commented 1 year ago

(Translated by Google)

Hello

I have already created and loaded for all the tables, a behavior very similar to the example in: timestampable. There, I override the preInsert and preUpdate methods. That works very well.

Now I need to be able to control this situation:

Can this be done with a behavior?

I tried to do it with the postDelete hook, but due to the constraint error, this method does not get executed.

I tried putting a delete function in the behavior, with the intention of overriding that method, but it doesn't seem to work or I didn't do it right.

Can someone tell me how to do this?