WIP: Implement crm selections
This commit is contained in:
@@ -55,4 +55,25 @@ class CrmAttributesResponse
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$crmSelections = [];
|
||||
|
||||
foreach ($this->getAttributeGroups() as $group) {
|
||||
/** @var CrmAttributeGroup $group */
|
||||
if (false === isset($crmSelections[$group->getLabel()])) {
|
||||
$crmSelections[$group->getLabel()] = [];
|
||||
}
|
||||
foreach ($group->getAttributes() as $attribute) {
|
||||
/** @var CrmAttribute $attribute */
|
||||
if (false === $attribute->isSelected()) {
|
||||
continue;
|
||||
}
|
||||
$crmSelections[$group->getLabel()][] = $attribute->getLabel();
|
||||
}
|
||||
}
|
||||
|
||||
return $crmSelections;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user