/** * @return array */ public function getTagsFunction() { return $this->memoizeCache->memoize(function () { $tags = $this->tagManager->findAll(); $context = SerializationContext::create(); $context->setSerializeNull(true); $context->setGroups(['partialTag']); return $this->serializer->serialize($tags, 'array', $context); }); }
/** * Returns an array of serialized categories. * If parentKey is set, only the children of the category which is assigned to the given key are returned. * * @param string $locale * @param string $parentKey key of parent category * * @return array */ public function getCategoriesFunction($locale, $parentKey = null) { return $this->memoizeCache->memoize(function ($locale, $parentKey = null) { $entities = $this->categoryManager->findChildrenByParentKey($parentKey); $categories = $this->categoryManager->getApiObjects($entities, $locale); $context = SerializationContext::create(); $context->setSerializeNull(true); return $this->serializer->serialize($categories, 'array', $context); }); }
/** * {@inheritdoc} */ public function loadSnippet($uuid, $locale = null) { return $this->memoizeCache->memoize([$this->extension, 'loadSnippet'], $this->lifeTime); }
/** * {@inheritdoc} */ public function load($uuid) { return $this->memoizeCache->memoize([$this->extension, 'load'], $this->lifeTime); }
/** * {@inheritdoc} */ public function sitemapFunction($locale = null, $webspaceKey = null) { return $this->memoizeCache->memoize([$this->extension, 'sitemapFunction'], $this->lifeTime); }
/** * {@inheritdoc} */ public function breadcrumbFunction($uuid) { return $this->memoizeCache->memoize([$this->extension, 'breadcrumbFunction'], $this->lifeTime); }