/** * @param AttributeGroup $group * * @return array */ public function getAllSources(AttributeGroup $group = null) { $sources = []; if ($this->isValid()) { $groups = $this->attributeGroupManager->getAllGroups(); foreach ($groups as $group) { $sources[] = ['id' => $group->getCode(), 'name' => $group->getCode()]; } } return $sources; }