You are here

LayoutService.php in Open Social 10.3.x

File

modules/social_features/social_core/src/Service/LayoutService.php
View source
<?php

namespace Drupal\social_core\Service;

use Drupal\Core\Entity\EntityInterface;
use Drupal\layout_builder\LayoutEntityHelperTrait;

/**
 * Class LayoutService.
 *
 * @package Drupal\social_core\Service
 */
class LayoutService {
  use LayoutEntityHelperTrait;

  /**
   * Determines if an entity can have a layout.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to check.
   *
   * @return bool
   *   TRUE if the entity can have a layout otherwise FALSE.
   */
  public function isTrueLayoutCompatibleEntity(EntityInterface $entity) {
    if (!\Drupal::moduleHandler()
      ->moduleExists('layout_builder')) {
      return FALSE;
    }
    return $this
      ->isLayoutCompatibleEntity($entity);
  }

}

Classes

Namesort descending Description
LayoutService Class LayoutService.