You are here

public function GridStack::getGridsByDelta in GridStack 8.2

2 calls to GridStack::getGridsByDelta()
GridStack::getGridPropertyByDelta in src/Entity/GridStack.php
Returns property by its key and delta.
GridStack::getNestedGridsByDelta in src/Entity/GridStack.php
Returns the current nested grids with preserved indices even if empty.

File

src/Entity/GridStack.php, line 213

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getGridsByDelta($delta = 0, $type = 'grids', $preserve = FALSE) {
  $grids = $this
    ->getLastBreakpoint($type);
  $grids = isset($grids[$delta]) ? $grids[$delta] : [];
  $check = array_filter($grids);
  return $preserve ? $grids : (empty($check) ? [] : $grids);
}