Skip to content

IBX-10685: Added information on how to add a custom attribute type to an existing storage definition#3068

Merged
mnocon merged 8 commits into5.0from
IBX-10685-Custom-attribute-type
Mar 13, 2026
Merged

IBX-10685: Added information on how to add a custom attribute type to an existing storage definition#3068
mnocon merged 8 commits into5.0from
IBX-10685-Custom-attribute-type

Conversation

@mateuszdebinski
Copy link
Contributor

@mateuszdebinski mateuszdebinski commented Mar 2, 2026

Question Answer
JIRA Ticket IBX-10685
Versions 4.6 and 5.0
Edition Commerce

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Preview of modified files

Preview of modified Markdown:

@dabrt
Copy link
Contributor

dabrt commented Mar 2, 2026

Hi @mateuszdebinski , would you like @reithor to approve the PR as DEV reviewer?

@mateuszdebinski
Copy link
Contributor Author

Hi @dabrt I asked @Steveb-p to review and approve

@mateuszdebinski mateuszdebinski self-assigned this Mar 3, 2026
@sonarqubecloud
Copy link

@github-actions
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php


code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php

docs/pim/create_custom_attribute_type.md@179:``` php
docs/pim/create_custom_attribute_type.md@180:[[= include_file('code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php') =]]
docs/pim/create_custom_attribute_type.md@181:```

001⫶<?php
002⫶/**
003⫶ * @copyright Copyright (C) Ibexa AS. All rights reserved.
004⫶ * @license For full copyright and license information view LICENSE file distributed with this source code.
005⫶ */
006⫶declare(strict_types=1);
007⫶
008⫶namespace App\DependencyInjection;
009⫶
010⫶use Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Float\StorageDefinition;
011⫶use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
012⫶use Symfony\Component\DependencyInjection\ContainerBuilder;
013⫶
014⫶class AddFloatStorageDefinitionTag implements CompilerPassInterface
015⫶{
016⫶ public function process(ContainerBuilder $container): void
017⫶ {
018⫶ $container->getDefinition(StorageDefinition::class)
019⫶ ->addTag('ibexa.product_catalog.attribute.storage_definition', ['type' => 'percent']);
020⫶ }
021⫶}


code_samples/catalog/custom_attribute_type/src/Kernel.php


code_samples/catalog/custom_attribute_type/src/Kernel.php

docs/pim/create_custom_attribute_type.md@186:``` php hl_lines="5 7-8 14-20"
docs/pim/create_custom_attribute_type.md@187:[[= include_file('code_samples/catalog/custom_attribute_type/src/Kernel.php') =]]
docs/pim/create_custom_attribute_type.md@188:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App;
004⫶
005❇️use App\DependencyInjection\AddFloatStorageDefinitionTag;
006⫶use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
007❇️use Symfony\Component\DependencyInjection\ContainerBuilder;
008❇️use Symfony\Component\HttpKernel\Kernel as BaseKernel;
009⫶
010⫶class Kernel extends BaseKernel
011⫶{
012⫶ use MicroKernelTrait;
013⫶
014❇️ public function build(ContainerBuilder $container): void
015❇️ {
016❇️ parent::build($container);
017❇️
018❇️ $container->addCompilerPass(new AddFloatStorageDefinitionTag());
019❇️ }
020❇️}

Download colorized diff

@mnocon mnocon merged commit f6f88aa into 5.0 Mar 13, 2026
9 checks passed
@mnocon mnocon deleted the IBX-10685-Custom-attribute-type branch March 13, 2026 11:55
mnocon pushed a commit that referenced this pull request Mar 13, 2026
… an existing storage definition (#3068)

* IBX-10685: Added information on how to add a custom attribute type to an existing storage definition

* PHP & JS CS Fixes

* Corrected CS

* PHP & JS CS Fixes

* Corrected CS

* regenerated deptrac baseline

---------

Co-authored-by: Mateusz Dębiński <mateusz.debinski@ibexa.co>
Co-authored-by: mateuszdebinski <mateuszdebinski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants