/** * @return FacetHandlerInterface[] */ private function registerFacetHandlers() { $facetHandlers = new ArrayCollection(); $facetHandlers = $this->eventManager->collect('Shopware_SearchBundleDBAL_Collect_Facet_Handlers', $facetHandlers); $this->assertCollectionIsInstanceOf($facetHandlers, __NAMESPACE__ . '\\FacetHandlerInterface'); return array_merge($facetHandlers->toArray(), $this->facetHandlers); }
public function testAppendEventWithNoListener() { $values = new ArrayCollection(array('foo', 'bar')); $values = $this->eventManager->collect('Shopware_Tests_Components_Event_ManagerTest_Append_testAppendEventWithNoListener', $values); $this->assertCount(2, $values->getValues()); $this->assertEquals('foo', $values->get(0)); $this->assertEquals('bar', $values->get(1)); }
/** * @param Shop\Template $template * @param Shop\Shop $shop * @return array|LessDefinition[] * @throws \Enlight_Event_Exception */ private function collectPluginCss(Shop\Template $template, Shop\Shop $shop) { $collection = new ArrayCollection(); $this->eventManager->collect('Theme_Compiler_Collect_Plugin_Css', $collection, ['shop' => $shop, 'template' => $template]); if ($collection->count() <= 0) { return []; } $definition = new LessDefinition(); $definition->setFiles($collection->toArray()); return [$definition]; }
/** * @return array * @throws \Enlight_Event_Exception */ private function registerRequestHandlers() { $requestHandlers = new ArrayCollection(); $requestHandlers = $this->eventManager->collect('Shopware_SearchBundle_Collect_Criteria_Request_Handlers', $requestHandlers); return array_merge($this->requestHandlers, $requestHandlers->toArray()); }
/** * @return MediaPosition[] */ private function getMediaPositions() { $mediaPositions = $this->getDefaultMediaPositions(); $mediaPositions = $this->events->collect('Shopware_Collect_MediaPositions', $mediaPositions); return $mediaPositions->toArray(); }
/** * @param $event * @param ArrayCollection $collection * @param null $eventArgs * @return ArrayCollection|null * @throws Enlight_Event_Exception */ public function collect($event, ArrayCollection $collection, $eventArgs = null) { $this->getPluginBootstrap()->addEvent($event, 'collect', $this->getListeners($event), $eventArgs); return $this->events->collect($event, $collection, $eventArgs); }