You are here

public function Panelizer::isPanelized in Panelizer 8.5

Same name and namespace in other branches
  1. 8.3 src/Panelizer.php \Drupal\panelizer\Panelizer::isPanelized()
  2. 8.4 src/Panelizer.php \Drupal\panelizer\Panelizer::isPanelized()

Checks if the given entity type, bundle and view mode are panelized.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle.

string $view_mode: The view mode.

\Drupal\Core\Entity\Display\EntityViewDisplayInterface|NULL $display: If the caller already has the correct display, it can optionally be passed in here so the Panelizer service doesn't have to look it up; otherwise, this argument can bo omitted.

Return value

bool TRUE if panelized; otherwise FALSE.

Overrides PanelizerInterface::isPanelized

2 calls to Panelizer::isPanelized()
Panelizer::getPanelizerSettings in src/Panelizer.php
Get the Panelizer settings for an entity type, bundle and view mode.
Panelizer::hasDefaultPermission in src/Panelizer.php
Checks if a user has permission to perform an operation on a default.

File

src/Panelizer.php, line 453

Class

Panelizer
The Panelizer service.

Namespace

Drupal\panelizer

Code

public function isPanelized($entity_type_id, $bundle, $view_mode, EntityViewDisplayInterface $display = NULL) {
  if (!$this
    ->getEntityPlugin($entity_type_id)) {
    return FALSE;
  }
  if (!$display) {
    $display = $this
      ->getEntityViewDisplay($entity_type_id, $bundle, $view_mode);
  }
  return $display
    ->getThirdPartySetting('panelizer', 'enable', FALSE);
}