Hi folks need some developer to explain me the difference between OW::getEventManager()->bind and OW::getEventManager()->call
Looks like call is limited to only one bind! If so then whats the point of using it?
Hi folks need some developer to explain me the difference between OW::getEventManager()->bind and OW::getEventManager()->call
Looks like call is limited to only one bind! If so then whats the point of using it?
it appears that call is used just for the last event listener and gets its value, so the fact that it only does one is a good thing, as the result will only be one
check out ow_core/event_manage.php line 251
Thanks dave.
Actually its not good thing!
This stuff should be restricted and not available for binding!
Yes it only grabs last event listener but if you bind to that event your function gonna be be the last one and the event this call was intended to never gets fired up!
I have noticed this in groups plugin!
It uses call function to call feed.add_follow.
I also need to bind to that event, that makes my function work but not the newsfeed.
This brakes down groups follow code and pretty much messes everything up!
Well marcus i will have to eat some crow on this one... i could not get an example to work at all.. you are right its really messed up... sorryAppreciate it dave. Happy new year man.
I agree it is poorly executed, the design works if done correctly. The way it is suppose to work is that if the request is not from the service file then it fails do to class protection.
The service file is public but the dao file is protected, so it allows for a extension of the protected class from the service file but no other file should be able to access the db queries in the dao file.
However it is broken and this is why there is a security risk with Oxwall. There is a proper way to do it as i have done it on a project myself, and any time there is a query request anywhere other than from the service file, it fails, that is the proper way.