You are here

LayoutBuilderRestrictionHelperTrait.php in Dashboards with Layout Builder 2.0.x

Namespace

Drupal\dashboards

File

src/LayoutBuilderRestrictionHelperTrait.php
View source
<?php

namespace Drupal\dashboards;

use Drupal\dashboards\Plugin\SectionStorage\DashboardSectionStorage;
use Drupal\dashboards\Plugin\SectionStorage\UserDashboardSectionStorage;
use Drupal\layout_builder\SectionStorageInterface;
trait LayoutBuilderRestrictionHelperTrait {
  public function isDashboardStorage(SectionStorageInterface $section) : bool {
    if ($section instanceof DashboardSectionStorage || $section instanceof UserDashboardSectionStorage) {
      return TRUE;
    }
    return FALSE;
  }

}