magentoVersion = $magentoVersion; $this->objectManager = $objectManager; } /** * @return Collection */ public function create() { if (version_compare($this->magentoVersion->get(), '2.3.2', '<')) { return $this->objectManager->create(Collection::class); } else { return $this->objectManager->create('elasticsearchAdvancedCollection'); } } }