34 public function setValues(
array $values): self
38 $filteredValues = $this->filterValues($values);
42 if (!empty($oldValuesToRemove))
49 if (in_array($item->getValue(), $oldValuesToRemove,
true))
51 $oldSections[] = $item;
55 $this->
remove(...$oldSections);
60 if (!empty($newValuesToAdd))
64 foreach ($newValuesToAdd as $value)
66 $newSections[] = $this
73 $this->
add(...$newSections);
86 $values[] = $item->getValue();
92 private function filterValues(
array $values):
array
94 Type\Collection::normalizeArrayValuesByInt($values);
107 if (
$res->isSuccess())