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

Phalcon Model Behavior - why isn't notify() emitted on afterFetch?

Hi all,

Got a question about the behaviour of Phalcon Model Behaviors:

https://docs.phalcon.io/en/latest/reference/models.html#behaviors

Is there a specific reason why Phalcon\Mvc\Model\Behavior::notify() is not emitted with "afterFetch" event type?

Thanks!



34.6k
Accepted
answer

Emit events to an events manager for every record fetch could make the app very slow.

Maybe instead of event manager use beanstalkd, queue, cron and Cli task? After fetch you can simply put the job to queue and do it in cli task instead of using event manager.



51.3k
edited Feb '16

@andresgutierrez

https://github.com/josefguenther/cphalcon/commit/746cfc394866af4c98ca10da8fb78da7af42d793

So it was implemented in 2.1. Does it mean the app is going to be "very slow" ?