trait ContentPublishingSettingsTrait in Acquia Lift Connector 8.4
Provides common methods for classes that involve publisher settings.
@package Drupal\acquia_lift_publisher\Form
Hierarchy
- trait \Drupal\acquia_lift_publisher\Form\ContentPublishingSettingsTrait
2 files declare their use of ContentPublishingSettingsTrait
- EntityRenderHandler.php in modules/
acquia_lift_publisher/ src/ EventSubscriber/ Cdf/ EntityRenderHandler.php - PublishOnlyRendered.php in modules/
acquia_lift_publisher/ src/ EventSubscriber/ Publish/ PublishOnlyRendered.php
File
- modules/
acquia_lift_publisher/ src/ Form/ ContentPublishingSettingsTrait.php, line 12
Namespace
Drupal\acquia_lift_publisher\FormView source
trait ContentPublishingSettingsTrait {
/**
* Acquia lift publisher configuration object.
*
* @var \Drupal\Core\Config\ImmutableConfig
* @see \Drupal\acquia_lift_publisher\Form\ContentPublishingForm
*/
private $publisherSettings;
/**
* Returns the value of the entity view modes setting.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The current entity.
*
* @return array
* The setting value.
*/
protected function getEntityViewModesSettingValue(EntityInterface $entity) : array {
return $this->publisherSettings
->get("view_modes.{$entity->getEntityTypeId()}.{$entity->bundle()}") ?? [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentPublishingSettingsTrait:: |
private | property | Acquia lift publisher configuration object. | |
ContentPublishingSettingsTrait:: |
protected | function | Returns the value of the entity view modes setting. |