class EntityChannelsAttribute in Acquia Content Hub 8.2
Notates the metadata with a CDF version marker.
Hierarchy
- class \Drupal\acquia_contenthub\EventSubscriber\CdfAttributes\EntityChannelsAttribute implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of EntityChannelsAttribute
1 string reference to 'EntityChannelsAttribute'
1 service uses EntityChannelsAttribute
File
- src/
EventSubscriber/ CdfAttributes/ EntityChannelsAttribute.php, line 13
Namespace
Drupal\acquia_contenthub\EventSubscriber\CdfAttributesView source
class EntityChannelsAttribute implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[AcquiaContentHubEvents::POPULATE_CDF_ATTRIBUTES][] = [
'onPopulateAttributes',
100,
];
return $events;
}
/**
* Documents entity languages as an attribute.
*
* @param \Drupal\acquia_contenthub\Event\CdfAttributesEvent $event
* The event being dispatched.
*
* @throws \Exception
*/
public function onPopulateAttributes(CdfAttributesEvent $event) {
$cdf = $event
->getCdf();
$cdf
->addAttribute('channels', CDFAttribute::TYPE_ARRAY_REFERENCE, []);
$cdf
->getAttribute('channels')
->setValue([]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityChannelsAttribute:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
EntityChannelsAttribute:: |
public | function | Documents entity languages as an attribute. |