Adds one or more breakpoints to this group.
The breakpoint name is either the machine_name or the id of a breakpoint.
array $breakpoints: Array containing breakpoints keyed by their id.
public function addBreakpoints($breakpoints) {
foreach ($breakpoints as $breakpoint_name) {
// Check if breakpoint exists, assume $breakpoint_name is a machine name.
$breakpoint = entity_load('breakpoint', $this->sourceType . '.' . $this->source . '.' . $breakpoint_name);
// If the breakpoint doesn't exist, assume $breakpoint_name is an id.
if (!$breakpoint) {
$breakpoint = entity_load('breakpoint', $breakpoint_name);
}
// If the breakpoint doesn't exists, do not add it.
if ($breakpoint) {
// Add breakpoint to group.
$this->breakpoints[$breakpoint
->id()] = $breakpoint;
}
}
}