Yes when we try to bend something, we can do whatever.
But it seems completely the Symfony way to call a function in the template, that load a service that is decorate by another that do SQL queries and publish internal event that are listen somewhere else in the application to override the result.