You are here

protected function RabbitHoleBehaviorPluginBase::getBundleSettings in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x src/Plugin/RabbitHoleBehaviorPluginBase.php \Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPluginBase::getBundleSettings()

Returns configuration object with "Rabbit Hole" bundle settings.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the action is being performed on.

Return value

\Drupal\Core\Config\ImmutableConfig Configuration object with bundle settings.

4 calls to RabbitHoleBehaviorPluginBase::getBundleSettings()
PageRedirect::getActionResponseCode in src/Plugin/RabbitHoleBehaviorPlugin/PageRedirect.php
Returns the action response code.
PageRedirect::getActionTarget in src/Plugin/RabbitHoleBehaviorPlugin/PageRedirect.php
Returns the action target URL object.
PageRedirect::getFallbackAction in src/Plugin/RabbitHoleBehaviorPlugin/PageRedirect.php
Returns the fallback action in case if action cannot be performed.
PageRedirect::settingsForm in src/Plugin/RabbitHoleBehaviorPlugin/PageRedirect.php
Return a settings form for the rabbit hole action.

File

src/Plugin/RabbitHoleBehaviorPluginBase.php, line 66

Class

RabbitHoleBehaviorPluginBase
Base class for Rabbit hole behavior plugin plugins.

Namespace

Drupal\rabbit_hole\Plugin

Code

protected function getBundleSettings(EntityInterface $entity) {
  $bundle_entity_type = $entity
    ->getEntityType()
    ->getBundleEntityType();
  return \Drupal::service('rabbit_hole.behavior_settings_manager')
    ->loadBehaviorSettingsAsConfig($bundle_entity_type ?: $entity
    ->getEntityType()
    ->id(), $bundle_entity_type ? $entity
    ->bundle() : NULL);
}