/** * @param GroupInterface $group * @param array $data */ protected function setAxis(GroupInterface $group, $data) { if (isset($data['axis']) && !empty($data['axis'])) { $axisCodes = explode(',', $data['axis']); $attributes = []; foreach ($axisCodes as $code) { $attribute = $this->attributeRepository->findOneByIdentifier($code); if (!$attribute) { throw new \LogicException(sprintf('Attribute with identifier "%s" not found', $code)); } $attributes[] = $attribute; } $group->setAxisAttributes($attributes); } }