/** * {@inheritdoc} */ public function getUrls() { if (is_null($this->urls) || $this->refresh === true) { $this->urls = []; $this->refresh = false; foreach ($this->options['images'] as $image) { $filterName = $this->mappingService->getImagineFilterName($this->className, $this->fieldName, $this->layout, $image); $this->urls[] = $this->cacheManager->getBrowserPath($this->sources[$image['index']], $filterName); } } return $this->urls; }
/** * @param object $obj * @param string $fieldName * @param string $layout * * @return ImageResourceManager * * @throws UndefinedImageMappingException */ protected function getResourceManager($obj, $fieldName, $layout) { $layout = !is_string($layout) || empty($layout) ? self::DEFAULT_LAYOUT_NAME : $layout; $accessor = PropertyAccess::createPropertyAccessor(); $hash = spl_object_hash($obj); if (is_null($accessor->getValue($this->resourceManagers, "[{$hash}][{$fieldName}][{$layout}]"))) { $loader = $this->getLoader($obj, $fieldName); $loader->load($this->mappingService->getConfigFileName(get_class($obj), $fieldName), $layout === self::DEFAULT_LAYOUT_NAME ? null : $layout); $accessor->setValue($this->resourceManagers, "[{$hash}][{$fieldName}][{$layout}]", $loader->getResourceManager()); $loader->unsetResourceManager(); } return $this->resourceManagers[$hash][$fieldName][$layout]; }