You are here

public function Panelizer::getDefaultPanelsDisplayByMachineName in Panelizer 8.3

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

Load a Panels Display via an ID (Machine Name).

Return value

\Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant|NULL The default Panels display with the given name if it exists; otherwise NULL.

File

src/Panelizer.php, line 152

Class

Panelizer
The Panelizer service.

Namespace

Drupal\panelizer

Code

public function getDefaultPanelsDisplayByMachineName($full_machine_name) {
  list($entity_type, $bundle, $view_mode, $machine_name) = explode('__', $full_machine_name);

  /** @var \Drupal\panelizer\Panelizer $panelizer */

  // @todo this $display_id looks all wrong to me since it's the name and view_mode.
  return $this
    ->getDefaultPanelsDisplay($machine_name, $entity_type, $bundle, $view_mode);
}