diff --git a/src/ChangeFilter/Category/services.yaml b/src/ChangeFilter/Category/services.yaml index 3cd4eaa..62d89f8 100644 --- a/src/ChangeFilter/Category/services.yaml +++ b/src/ChangeFilter/Category/services.yaml @@ -1,3 +1,6 @@ +parameters: + sitemap.object_type.category: 'category' + services: _defaults: @@ -6,7 +9,7 @@ services: FreshAdvance\Sitemap\ChangeFilter\Category\CategoryChangeFilter: arguments: - $pageTypeConfiguration: '@FreshAdvance\Sitemap\Url\DataTypeFactory\CategoryUrlType' + $objectType: '%sitemap.object_type.category%' $modelItemRepository: '@FreshAdvance\Sitemap\ChangeFilter\Category\CategoryChangeFilterItemRepository' tags: - 'sitemap.change_filter' @@ -15,3 +18,12 @@ services: class: FreshAdvance\Sitemap\ChangeFilter\Shared\Repository\ModelItemRepository arguments: $model: '\OxidEsales\Eshop\Application\Model\Category' + + FreshAdvance\Sitemap\ChangeFilter\Category\CategoryUrlType: + class: FreshAdvance\Sitemap\Url\DataType\UrlType + arguments: + $objectType: '%sitemap.object_type.category%' + $changeFrequency: 'daily' + $priority: 0.7 + tags: + - 'sitemap.page_type_configuration' diff --git a/src/ChangeFilter/Content/services.yaml b/src/ChangeFilter/Content/services.yaml index 104e70f..b354f5b 100644 --- a/src/ChangeFilter/Content/services.yaml +++ b/src/ChangeFilter/Content/services.yaml @@ -1,3 +1,6 @@ +parameters: + sitemap.object_type.content: 'content' + services: _defaults: @@ -6,7 +9,7 @@ services: FreshAdvance\Sitemap\ChangeFilter\Content\ContentChangeFilter: arguments: - $pageTypeConfiguration: '@FreshAdvance\Sitemap\Url\DataTypeFactory\ContentUrlType' + $objectType: '%sitemap.object_type.content%' $modelItemRepository: '@FreshAdvance\Sitemap\ChangeFilter\Content\ContentChangeFilterItemRepository' tags: - 'sitemap.change_filter' @@ -15,3 +18,12 @@ services: class: FreshAdvance\Sitemap\ChangeFilter\Shared\Repository\ModelItemRepository arguments: $model: '\OxidEsales\Eshop\Application\Model\Content' + + FreshAdvance\Sitemap\ChangeFilter\Content\ContentUrlType: + class: FreshAdvance\Sitemap\Url\DataType\UrlType + arguments: + $objectType: '%sitemap.object_type.content%' + $changeFrequency: 'weekly' + $priority: 0.3 + tags: + - 'sitemap.page_type_configuration' diff --git a/src/ChangeFilter/Product/services.yaml b/src/ChangeFilter/Product/services.yaml index 95f0a32..2c1b6eb 100644 --- a/src/ChangeFilter/Product/services.yaml +++ b/src/ChangeFilter/Product/services.yaml @@ -1,3 +1,6 @@ +parameters: + sitemap.object_type.product: 'product' + services: _defaults: @@ -6,7 +9,7 @@ services: FreshAdvance\Sitemap\ChangeFilter\Product\ProductChangeFilter: arguments: - $pageTypeConfiguration: '@FreshAdvance\Sitemap\Url\DataTypeFactory\ProductUrlType' + $objectType: '%sitemap.object_type.product%' $modelItemRepository: '@FreshAdvance\Sitemap\ChangeFilter\Product\ProductChangeFilterItemRepository' tags: - 'sitemap.change_filter' @@ -15,3 +18,12 @@ services: class: FreshAdvance\Sitemap\ChangeFilter\Shared\Repository\ModelItemRepository arguments: $model: '\OxidEsales\Eshop\Application\Model\Article' + + FreshAdvance\Sitemap\ChangeFilter\Product\ProductUrlType: + class: FreshAdvance\Sitemap\Url\DataType\UrlType + arguments: + $objectType: '%sitemap.object_type.product%' + $changeFrequency: 'daily' + $priority: 0.4 + tags: + - 'sitemap.page_type_configuration' diff --git a/src/ChangeFilter/Shared/ChangeFilterTemplate.php b/src/ChangeFilter/Shared/ChangeFilterTemplate.php index 8046c2a..1e4cf97 100644 --- a/src/ChangeFilter/Shared/ChangeFilterTemplate.php +++ b/src/ChangeFilter/Shared/ChangeFilterTemplate.php @@ -24,7 +24,7 @@ abstract class ChangeFilterTemplate public function __construct( ConnectionProviderInterface $connectionProvider, - protected UrlTypeInterface $pageTypeConfiguration, + protected string $objectType, protected ModelItemRepositoryInterface $modelItemRepository, ) { $this->connection = $connectionProvider->get(); @@ -57,7 +57,7 @@ public function queryAndFetchObjectUrl(string $query, array $queryParameters): G public function getObjectType(): string { - return $this->pageTypeConfiguration->getObjectType(); + return $this->objectType; } protected function getQueryParameters(): array diff --git a/src/Url/DataTypeFactory/services.yaml b/src/Url/DataTypeFactory/services.yaml index a323d96..f4f9cfc 100644 --- a/src/Url/DataTypeFactory/services.yaml +++ b/src/Url/DataTypeFactory/services.yaml @@ -19,30 +19,3 @@ services: $objectType: 'default' $changeFrequency: 'daily' $priority: 0.5 - - FreshAdvance\Sitemap\Url\DataTypeFactory\ProductUrlType: - class: FreshAdvance\Sitemap\Url\DataType\UrlType - arguments: - $objectType: 'product' - $changeFrequency: 'daily' - $priority: 0.4 - tags: - - 'sitemap.page_type_configuration' - - FreshAdvance\Sitemap\Url\DataTypeFactory\CategoryUrlType: - class: FreshAdvance\Sitemap\Url\DataType\UrlType - arguments: - $objectType: 'category' - $changeFrequency: 'daily' - $priority: 0.7 - tags: - - 'sitemap.page_type_configuration' - - FreshAdvance\Sitemap\Url\DataTypeFactory\ContentUrlType: - class: FreshAdvance\Sitemap\Url\DataType\UrlType - arguments: - $objectType: 'content' - $changeFrequency: 'weekly' - $priority: 0.3 - tags: - - 'sitemap.page_type_configuration'