Sylius / SyliusElasticSearchPlugin

DEPRECATED! Use https://github.com/BitBagCommerce/SyliusElasticsearchPlugin instead.
22 stars 26 forks source link

Fix document type hinting #97

Open einorler opened 6 years ago

einorler commented 6 years ago

I've took some closer look on the case of collection type hinting. Firstly, the setter is mandatory, so sorry for my previous comment, secondly ONGR collection class is deprecated and not recommended anymore, in stead I changed the type hinting to use Doctrine\Common\Collections\Collection interface, because this includes both Doctrine\Common\Collections\ArrayCollection that is recommended by the ONGR collection deprecation message (see here: https://github.com/ongr-io/ElasticsearchBundle/blob/a2642ee9549f3906f2d22d88479364ccc1a542f9/Collection/Collection.php#L19) and ONGR\ElasticsearchBundle\Result\ObjectIterator that ONGR ES bundle uses when lazy loading the results after search. However, this is a potential place to pay close attention to in the future, because I contacted the maintainer of the ONGR project and I was informed that this is a known issue in ONGR ES bundle and will be attended to in the comming months.

Closes #95