You are here

public function GridStack::getNestedGridsByDelta in GridStack 8

Same name and namespace in other branches
  1. 8.2 src/Entity/GridStack.php \Drupal\gridstack\Entity\GridStack::getNestedGridsByDelta()

Returns the current nested grids with preserved indices even if empty.

Only cares for the last breakpoint, others inherit its structure. The reason is all breakpoints may have different DOM positionings, heights and widths each, but they must have the same grid structure.

Parameters

int $delta: The current delta.

Return value

mixed|array Available grids by the given $delta parameter, else empty.

File

src/Entity/GridStack.php, line 214

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getNestedGridsByDelta($delta = 0) {
  $grids = $this
    ->getEndBreakpointGrids('nested');
  $nested = isset($grids[$delta]) ? $grids[$delta] : [];
  $check = array_filter($nested);
  return empty($check) ? [] : $nested;
}