We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Removing Model Behavior

How can I remove an already set Behavior?

I my modelBase, I initialize it with softDelete Behavior. How can I remove it in extended model?



32.2k

I don't think there is a way to remove a Behavior. Your best bet is to overwrite the initialize() method on the child class.

I've already tried, but child class is still using the behavior, even with an empty initialize() { }. And I'am not calling parent::initialize()...