PHPackages                             mediarox/module-catalog-attribute-setup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mediarox/module-catalog-attribute-setup

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

mediarox/module-catalog-attribute-setup
=======================================

Contains an alternative attributes setup class that includes an optimized create/update mechanism.

0.0.9(5d ago)0390MITPHPPHP ~8.1|~8.2|~8.3|~8.4

Since Oct 22Pushed 5d agoCompare

[ Source](https://github.com/mediarox/module-catalog-attribute-setup)[ Packagist](https://packagist.org/packages/mediarox/module-catalog-attribute-setup)[ RSS](/packages/mediarox-module-catalog-attribute-setup/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (12)Versions (10)Used By (0)

### Description

[](#description)

A Magento 2 module/library that contains an alternative attributes setup class. It is intended to simplify the creation/updating of product and category attributes.

### Installation

[](#installation)

```
composer require mediarox/module-catalog-attribute-setup
bin/magento setup:upgrade
```

### Usage

[](#usage)

In most use cases we "use" the supplied setup class

```
use Catalog\AttributeSetup\Setup\AttributeSetup;
```

or more specific

```
use Catalog\AttributeSetup\Setup\AttributeSetupFactory;
```

inside a patch file (Recurring or DataPatch).

Our goal was that each patch that wants to install/update attributes only needs to provide an array of information. Everything else is then taken care of by the setup class.

To make the point effectively, take note of the following example.

#### Example 1 - RecurringData patch

[](#example-1---recurringdata-patch)

Force product attribute setting with [recurring data patch](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/prepare/lifecycle.html#recurring-data-event) (useful for development/not released projects).

`/Setup/RecurringData.php`

```
use Magento\Catalog\Model\Product;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Catalog\AttributeSetup\Setup\AttributeSetup;
use Catalog\AttributeSetup\Setup\AttributeSetupFactory;

class RecurringData implements InstallDataInterface
{
    protected AttributeSetupFactory $attributeSetup;

    public function __construct(
        AttributeSetupFactory $attributeSetup
    ) {
        $this->attributeSetup = $attributeSetup;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var AttributeSetup $attributeSetup */
        $attributeSetup = $this->attributeSetup->create([
            'setup' => $setup,
            'attributeData' => $this->getAttributes()
        ]);

        $setup->startSetup();
        $attributeSetup->addUpdateAttributes();
        $setup->endSetup();
    }

    public function getAttributes() : array
    {
        return [
            Product::ENTITY => [
                'manufacturer' => [
                    'is_filterable' => 0
                ]
            ]
        ];
    }
}
```

###### Example explanations

[](#example-explanations)

1. We always use the "getAttributes()" method internally to provide the attribute information. Feel free to do this differently.
2. RecurringData patches use the "install" method as the main entry point. (In DataPatches, the "apply" method is used).
3. RecurringData patches are executed on every "bin/magento setup:upgrade". Please use a [DataPatch](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/data-patches.html) if you want to run only once.
4. As usual in Magento, we still use a factory class with which we create new instances. (AttributeSetupFactory)
5. In the "install" method we first create the new instance via the internal method "create" and pass our attribute information right away. ```
    $attributeSetup = $this->attributeSetup->create([
    'setup' => $setup,
    'attributeData' => $this->getAttributes()
    ]);
    ```
6. Then, we run the "addUpdateAttributes" method on the instance to start the create/update process. ```
     $attributeSetup->addUpdateAttributes();
    ```

### Additional notes (yes, important)

[](#additional-notes-yes-important)

#### Attribute information structure

[](#attribute-information-structure)

As you can see in the example, the attributes array is grouped into the respective entity. ('catalog\_product' or 'catalog\_category')

#### Attribute property names

[](#attribute-property-names)

Magento unfortunately **does not use a uniform name for the attribute properties**. In some cases you have to use the short form and in others the long form. As a result, **we have decided** to uniformly push **the long form**. Following this, the module loads module [eav-property-mapper](https://github.com/mediarox/module-eav-property-mapper) as a dependency to ensure that we can/must use the long form across the board. ([All short and long forms](https://github.com/mediarox/module-eav-property-mapper/blob/main/Plugin/Entity/Setup/PropertyMapper.php))

In summary: **The long form must be used.** If not, the script will abort due to validation.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance99

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 63.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~250 days

Recently: every ~428 days

Total

8

Last Release

5d ago

PHP version history (3 changes)0.0.2PHP ~7.4.0

0.0.6PHP ~7.4.0|~8.0|~8.1

0.0.9PHP ~8.1|~8.2|~8.3|~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1479824?v=4)[mediarox](/maintainers/mediarox)[@mediarox](https://github.com/mediarox)

---

Top Contributors

[![sfritzsche](https://avatars.githubusercontent.com/u/32567473?v=4)](https://github.com/sfritzsche "sfritzsche (19 commits)")[![codebase-md](https://avatars.githubusercontent.com/u/20788290?v=4)](https://github.com/codebase-md "codebase-md (11 commits)")

### Embed Badge

![Health badge](/badges/mediarox-module-catalog-attribute-setup/health.svg)

```
[![Health](https://phpackages.com/badges/mediarox-module-catalog-attribute-setup/health.svg)](https://phpackages.com/packages/mediarox-module-catalog-attribute-setup)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69362.0k](/packages/run-as-root-magento2-prometheus-exporter)[nosto/module-nostotagging

Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.

27714.5k4](/packages/nosto-module-nostotagging)[buckaroo/magento2

Buckaroo Magento 2 extension

32426.0k8](/packages/buckaroo-magento2)[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1861.2k](/packages/myparcelnl-magento)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1015.1k29](/packages/loki-magento2-components)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
