Answer the question
In order to leave comments, you need to log in
How to override class in symphony project?
There is a bundle of bundles in the project
There is a search service that returns an array of objects of the type Some\Bundle\SearchHit
this class is not specified in yml all this bundle of bundles has
use Some\Bundle\SearchHit
in the top lines of the code
I need to add a new method to it. how can this be done?
final task
{% for hit in results %}
{% include hit.getLineTemplete() with { content: hit } %}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
I'm afraid that if the bundle is not originally designed to extend objects SearchHit
and SearchHit is hardcoded there, as you say, you will have to completely redefine the entire service that collects them ("search service").
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question