|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (ModuleDataSetupInterface $setup, Context $context, CacheInterface $cache, CollectionFactory $attrGroupCollectionFactory) | |
| getSetup () | |
| getAttributeGroupCollectionFactory () | |
| cleanCache () | |
| installDefaultGroupIds () | |
| addEntityType ($code, array $params) | |
| updateEntityType ($code, $field, $value=null) | |
| getEntityType ($id, $field=null) | |
| getEntityTypeId ($entityTypeId) | |
| removeEntityType ($id) | |
| getAttributeSetSortOrder ($entityTypeId, $sortOrder=null) | |
| addAttributeSet ($entityTypeId, $name, $sortOrder=null, $setId=null) | |
| updateAttributeSet ($entityTypeId, $id, $field, $value=null) | |
| getAttributeSet ($entityTypeId, $id, $field=null) | |
| getAttributeSetId ($entityTypeId, $setId) | |
| removeAttributeSet ($entityTypeId, $id) | |
| setDefaultSetToEntityType ($entityType, $attributeSet='Default') | |
| getAllAttributeSetIds ($entityTypeId=null) | |
| getDefaultAttributeSetId ($entityType) | |
| getAttributeGroupSortOrder ($entityTypeId, $setId, $sortOrder=null) | |
| addAttributeGroup ($entityTypeId, $setId, $name, $sortOrder=null) | |
| convertToAttributeGroupCode ($groupName) | |
| updateAttributeGroup ($entityTypeId, $setId, $id, $field, $value=null) | |
| getAttributeGroup ($entityTypeId, $setId, $id, $field=null) | |
| getAttributeGroupByCode ($entityTypeId, $setId, $code, $field=null) | |
| getAttributeGroupId ($entityTypeId, $setId, $groupId) | |
| removeAttributeGroup ($entityTypeId, $setId, $id) | |
| getDefaultAttributeGroupId ($entityType, $attributeSetId=null) | |
| getAttributesNumberInGroup ($entityTypeId, $setId, $groupId) | |
| addAttribute ($entityTypeId, $code, array $attr) | |
| addAttributeOption ($option) | |
| updateAttribute ($entityTypeId, $id, $field, $value=null, $sortOrder=null) | |
| getAttribute ($entityTypeId, $id, $field=null) | |
| getAttributeId ($entityTypeId, $id) | |
| getAttributeTable ($entityTypeId, $id) | |
| removeAttribute ($entityTypeId, $code) | |
| getAttributeSortOrder ($entityTypeId, $setId, $groupId, $sortOrder=null) | |
| addAttributeToSet ($entityTypeId, $setId, $groupId, $attributeId, $sortOrder=null) | |
| addAttributeToGroup ($entityType, $setId, $groupId, $attributeId, $sortOrder=null) | |
| getDefaultEntities () | |
| installEntities ($entities=null) | |
@api @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @codeCoverageIgnore
Definition at line 25 of file EavSetup.php.
| __construct | ( | ModuleDataSetupInterface | $setup, |
| Context | $context, | ||
| CacheInterface | $cache, | ||
| CollectionFactory | $attrGroupCollectionFactory | ||
| ) |
Init
| ModuleDataSetupInterface | $setup | |
| Context | $context | |
| CacheInterface | $cache | |
| CollectionFactory | $attrGroupCollectionFactory |
Definition at line 91 of file EavSetup.php.
| addAttribute | ( | $entityTypeId, | |
| $code, | |||
| array | $attr | ||
| ) |
Add attribute to an entity type
If attribute is system will add to all existing attribute sets
| string | integer | $entityTypeId | |
| string | $code | |
| array | $attr |
Definition at line 819 of file EavSetup.php.
| addAttributeGroup | ( | $entityTypeId, | |
| $setId, | |||
| $name, | |||
$sortOrder = null |
|||
| ) |
Add Attribute Group
| int | string | $entityTypeId | |
| int | string | $setId | |
| string | $name | |
| int | $sortOrder |
Definition at line 533 of file EavSetup.php.
| addAttributeOption | ( | $option | ) |
Add Attribute Option
| array | $option |
Definition at line 884 of file EavSetup.php.
| addAttributeSet | ( | $entityTypeId, | |
| $name, | |||
$sortOrder = null, |
|||
$setId = null |
|||
| ) |
Add Attribute Set
| int | string | $entityTypeId | |
| string | $name | |
| int | $sortOrder | |
| int | $setId |
Definition at line 331 of file EavSetup.php.
| addAttributeToGroup | ( | $entityType, | |
| $setId, | |||
| $groupId, | |||
| $attributeId, | |||
$sortOrder = null |
|||
| ) |
Add or update attribute to group
| int | string | $entityType | |
| int | string | $setId | |
| int | string | $groupId | |
| int | string | $attributeId | |
| int | $sortOrder |
Definition at line 1334 of file EavSetup.php.
| addAttributeToSet | ( | $entityTypeId, | |
| $setId, | |||
| $groupId, | |||
| $attributeId, | |||
$sortOrder = null |
|||
| ) |
Add Attribute to All Groups on Attribute Set
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $groupId | |
| int | string | $attributeId | |
| int | $sortOrder |
Definition at line 1285 of file EavSetup.php.
| addEntityType | ( | $code, | |
| array | $params | ||
| ) |
Add an entity type
If already exists updates the entity type with params data
| string | $code | |
| array | $params |
Definition at line 184 of file EavSetup.php.
| cleanCache | ( | ) |
| convertToAttributeGroupCode | ( | $groupName | ) |
| getAllAttributeSetIds | ( | $entityTypeId = null | ) |
Get identifiers of all attribute sets
| int | string | null | $entityTypeId |
Definition at line 459 of file EavSetup.php.
| getAttribute | ( | $entityTypeId, | |
| $id, | |||
$field = null |
|||
| ) |
Retrieve Attribute Data By Id or Code
| int | string | $entityTypeId | |
| int | string | $id | |
| string | $field |
Definition at line 1128 of file EavSetup.php.
| getAttributeGroup | ( | $entityTypeId, | |
| $setId, | |||
| $id, | |||
$field = null |
|||
| ) |
Retrieve Attribute Group Data
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $id | |
| string | $field |
Definition at line 614 of file EavSetup.php.
| getAttributeGroupByCode | ( | $entityTypeId, | |
| $setId, | |||
| $code, | |||
$field = null |
|||
| ) |
Retrieve Attribute Group Data by Code
| int | string | $entityTypeId | |
| int | string | $setId | |
| string | $code | |
| string | $field |
Definition at line 648 of file EavSetup.php.
| getAttributeGroupCollectionFactory | ( | ) |
Gets attribute group collection factory
Definition at line 118 of file EavSetup.php.
| getAttributeGroupId | ( | $entityTypeId, | |
| $setId, | |||
| $groupId | |||
| ) |
Retrieve Attribute Group Id by Id or Name
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $groupId |
| LocalizedException |
Definition at line 669 of file EavSetup.php.
| getAttributeGroupSortOrder | ( | $entityTypeId, | |
| $setId, | |||
$sortOrder = null |
|||
| ) |
Retrieve Attribute Group Sort order
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | $sortOrder |
Definition at line 507 of file EavSetup.php.
| getAttributeId | ( | $entityTypeId, | |
| $id | |||
| ) |
Retrieve Attribute Id Data By Id or Code
| int | string | $entityTypeId | |
| int | string | $id |
Definition at line 1177 of file EavSetup.php.
| getAttributeSet | ( | $entityTypeId, | |
| $id, | |||
$field = null |
|||
| ) |
Retrieve Attribute set data by id or name
| int | string | $entityTypeId | |
| int | string | $id | |
| string | $field |
Definition at line 389 of file EavSetup.php.
| getAttributeSetId | ( | $entityTypeId, | |
| $setId | |||
| ) |
Retrieve Attribute Set Id By Id or Name
| int | string | $entityTypeId | |
| int | string | $setId |
| LocalizedException |
Definition at line 409 of file EavSetup.php.
| getAttributeSetSortOrder | ( | $entityTypeId, | |
$sortOrder = null |
|||
| ) |
Retrieve Attribute Set Sort order
| int | string | $entityTypeId | |
| int | $sortOrder |
Definition at line 305 of file EavSetup.php.
| getAttributesNumberInGroup | ( | $entityTypeId, | |
| $setId, | |||
| $groupId | |||
| ) |
Get number of all attributes in group
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $groupId |
Definition at line 740 of file EavSetup.php.
| getAttributeSortOrder | ( | $entityTypeId, | |
| $setId, | |||
| $groupId, | |||
$sortOrder = null |
|||
| ) |
Retrieve Attribute Sort Order
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $groupId | |
| int | $sortOrder |
Definition at line 1258 of file EavSetup.php.
| getAttributeTable | ( | $entityTypeId, | |
| $id | |||
| ) |
Return table name for eav attribute
| int | string | $entityTypeId | Entity Type id or Entity Type code |
| int | string | $id | Attribute id or Attribute code |
Definition at line 1195 of file EavSetup.php.
| getDefaultAttributeGroupId | ( | $entityType, | |
$attributeSetId = null |
|||
| ) |
Retrieve Default Attribute Group Id By Entity Type and Attribute Set
| string | int | $entityType | |
| int | $attributeSetId |
Definition at line 710 of file EavSetup.php.
| getDefaultAttributeSetId | ( | $entityType | ) |
Retrieve Default Attribute Set for Entity Type
| string | int | $entityType |
Definition at line 479 of file EavSetup.php.
| getDefaultEntities | ( | ) |
| getEntityType | ( | $id, | |
$field = null |
|||
| ) |
Retrieve Entity Type Data
| int | string | $id | |
| string | $field |
Definition at line 250 of file EavSetup.php.
| getEntityTypeId | ( | $entityTypeId | ) |
Retrieve Entity Type Id By Id or Code
| int | string | $entityTypeId |
| LocalizedException |
Definition at line 267 of file EavSetup.php.
| getSetup | ( | ) |
| installDefaultGroupIds | ( | ) |
Install Default Group Ids
Definition at line 139 of file EavSetup.php.
| installEntities | ( | $entities = null | ) |
Install entities
| array | $entities |
Definition at line 1416 of file EavSetup.php.
| removeAttribute | ( | $entityTypeId, | |
| $code | |||
| ) |
Remove Attribute
| int | string | $entityTypeId | |
| int | string | $code |
Definition at line 1235 of file EavSetup.php.
| removeAttributeGroup | ( | $entityTypeId, | |
| $setId, | |||
| $id | |||
| ) |
Remove Attribute Group By Id or Name
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $id |
Definition at line 693 of file EavSetup.php.
| removeAttributeSet | ( | $entityTypeId, | |
| $id | |||
| ) |
Remove Attribute Set
| int | string | $entityTypeId | |
| int | string | $id |
Definition at line 428 of file EavSetup.php.
| removeEntityType | ( | $id | ) |
Remove entity type by Id or Code
| int | string | $id |
Definition at line 285 of file EavSetup.php.
| setDefaultSetToEntityType | ( | $entityType, | |
$attributeSet = 'Default' |
|||
| ) |
Set Default Attribute Set to Entity Type
| int | string | $entityType | |
| string | $attributeSet |
Definition at line 445 of file EavSetup.php.
| updateAttribute | ( | $entityTypeId, | |
| $id, | |||
| $field, | |||
$value = null, |
|||
$sortOrder = null |
|||
| ) |
Update Attribute data and Attribute additional data
| int | string | $entityTypeId | |
| int | string | $id | |
| string | array | $field | |
| mixed | $value | |
| int | $sortOrder |
Definition at line 954 of file EavSetup.php.
| updateAttributeGroup | ( | $entityTypeId, | |
| $setId, | |||
| $id, | |||
| $field, | |||
$value = null |
|||
| ) |
Update Attribute Group Data
| int | string | $entityTypeId | |
| int | string | $setId | |
| int | string | $id | |
| string | $field | |
| mixed | $value |
Definition at line 590 of file EavSetup.php.
| updateAttributeSet | ( | $entityTypeId, | |
| $id, | |||
| $field, | |||
$value = null |
|||
| ) |
Update attribute set data
| int | string | $entityTypeId | |
| int | $id | |
| string | $field | |
| mixed | $value |
Definition at line 367 of file EavSetup.php.
| updateEntityType | ( | $code, | |
| $field, | |||
$value = null |
|||
| ) |
Update entity row
| string | $code | |
| string | $field | |
| string | $value |
Definition at line 231 of file EavSetup.php.