/** * Append to attributes array subattribute's models * * @param array $attributes * @return array */ protected function _initGroupAttributes($attributes) { $group = $this->_config->getAttributeGroupsFlat(); foreach ($group as $child => $parent) { if (isset($attributes[$parent]) && !isset($attributes[$parent]['group_attribute_' . $child])) { $attributes[$parent]->addData(['group_attribute_' . $child => $this->_attributeFactory->createAttribute($child)]); } } return $attributes; }