I'm using NelmioSolariumBundle in a symfony project to integrate solarium.
My controller
$query = $this->client->createSelect(array(
'documentclass' => 'MY\SolariumDocument'
));
In my custom documentclass
, I have a field that store a reference of the category of the document retrived from solr. I need to replace that reference with the correspondent label.
That's why I thought of injecting doctrine.orm.entity_manager
into my documentclass
.
I turned it into a service and through a setter I injected the entity manager but it didn't work getRepository on non-object
which makes sense because that transformation is made in the constructor.
How do I transform attributes of my documentclass
through doctrine.orm.entity_manager
?
the best way is factor class which uses solr and the entity-manager.
You can try the solr-bundle. It integrates solr-documents/indexing into doctrine.