OK, after 6 hours of digging I found that problem occurs in the following block:
static PHP_METHOD(Phalcon_Mvc_Model_Manager, notifyEvent){
if (phalcon_array_isset(custom_events_manager, entity_name)) {
PHALCON_INIT_NVAR(fire_event_name);
PHALCON_CONCAT_SV(fire_event_name, "mTodel:", event_name);
PHALCON_INIT_NVAR(status);
phalcon_call_method_p2_key(status, custom_events_manager, "fire", 210712414539UL, fire_event_name, model);
if (PHALCON_IS_FALSE(status)) {
RETURN_CCTOR(status);
}
}
}
Firing "model:beforeValidation" event crashes execution.
When calling phalcon_call_method_p2_key() method, "custom_events_manager" is not an object - it is an array, where model is indexed by array key name ("entity_name" here?).
Thus, shouldn't be call made on the "custom_events_manager->entity_name" ?
Thanks!