public function BulkVariationsCreator::getIefFormNotUsedAttributesCombination in Commerce Bulk 8
Gets first not used combination on a product IEF form.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the commerce_product form with at least one variation created.
string $ief_id: A product form IEF widget id.
Return value
array|null a number of possible and duplicated and used combinations, last variation, number of duplicated combinations and an HTML list of duplicated variations labels if they are found:
- "last_variation": The variation on the last inline entity form array.
- "count": The number of all combinations.
- "duplicated": The number of duplicated combinations.
- "used": The number of used combinations.
- "duplications_list": HTML list of duplicated combinations if present.
- "not_used_combination": The first not used attributes combination.
Overrides BulkVariationsCreatorInterface::getIefFormNotUsedAttributesCombination
File
- src/
BulkVariationsCreator.php, line 299
Class
- BulkVariationsCreator
- Default implementation of the BulkVariationsCreatorInterface.
Namespace
Drupal\commerce_bulkCode
public function getIefFormNotUsedAttributesCombination(FormStateInterface $form_state, $ief_id = '') {
$this->entityTypeManager = NULL;
$ief_entities = $form_state
->get([
'inline_entity_form',
$ief_id,
'entities',
]) ?: [];
return $this
->getNotUsedAttributesCombination(array_column($ief_entities, 'entity'));
}