/** * Get warning information if there is any skipped variant group (no common attribute with products). * Return all skipped variant groups with their label and code, or an empty array if no variant group skipped. * * @param array $validVariantGroups * * @return array */ protected function getSkippedVariantGroupsInfos(array $validVariantGroups) { // For now, we show all label and code of skipped groups (not good if too many) if ($validVariantGroups) { $validIds = array_map(function (GroupInterface $validGroup) { return $validGroup->getId(); }, $validVariantGroups); $invalidVariantGroups = $this->groupRepository->getVariantGroupsByIds($validIds, false); } else { $invalidVariantGroups = $this->groupRepository->getAllVariantGroups(); } return array_map(function (GroupInterface $variantGroup) { return sprintf('%s [%s]', $variantGroup->getLabel(), $variantGroup->getCode()); }, $invalidVariantGroups); }
/** * Get valid variant groups to display * * @return array */ public function getVariantGroups() { return $this->groupRepository->getAllVariantGroups(); }
/** * {@inheritdoc} */ protected function readItems() { return $this->repository->getAllVariantGroups(); }