You are here

public function EntityChannelsAttribute::onPopulateAttributes in Acquia Content Hub 8.2

Documents entity languages as an attribute.

Parameters

\Drupal\acquia_contenthub\Event\CdfAttributesEvent $event: The event being dispatched.

Throws

\Exception

File

src/EventSubscriber/CdfAttributes/EntityChannelsAttribute.php, line 32

Class

EntityChannelsAttribute
Notates the metadata with a CDF version marker.

Namespace

Drupal\acquia_contenthub\EventSubscriber\CdfAttributes

Code

public function onPopulateAttributes(CdfAttributesEvent $event) {
  $cdf = $event
    ->getCdf();
  $cdf
    ->addAttribute('channels', CDFAttribute::TYPE_ARRAY_REFERENCE, []);
  $cdf
    ->getAttribute('channels')
    ->setValue([]);
}