Skip to content

Category Attributes

Code Slicer edited this page May 18, 2023 · 8 revisions

Allows managing the eav attributes related to categories. Import it as follows:

private Migration\Facade\CategoryAttribute $categoryAttribute;

public function __construct(
    Migration\Context $context,
    Migration\Facade\CategoryAttribute $categoryAttribute
) {
    parent::__construct($context);
    $this->categoryAttribute = $categoryAttribute;
}

Inherit Methods

💡 Tip: all eav attribute capabilities are available for this entity:
https://github.com/discorgento/module-migrations/wiki/Eav-Attributes

massUpdate($entityIds, $data)

Mass update given categories. Notice that this updates given entity attribute values, not the attribute itself as in previous examples. Eg.:

$categoryIds = [4, 5];
$this->categoryAttribute->massUpdate($categoryIds, [
    'description' => 'Clothes',
]);