You are here

private function PublishOnlyRendered::getCdfEntityAttributeValue in Acquia Lift Connector 8.4

Returns an arbitrary attribute's value.

Parameters

\Acquia\ContentHubClient\CDF\CDFObject $cdf: The cdf object in hand.

string $attribute: The attribute to get from the cdf.

Return value

mixed|null The attribute value could be several type. If the there's no value, or the attribute doesn't exist for some reason, return NULL.

2 calls to PublishOnlyRendered::getCdfEntityAttributeValue()
PublishOnlyRendered::onEnqueueCandidateEntity in modules/acquia_lift_publisher/src/EventSubscriber/Publish/PublishOnlyRendered.php
Checks if the entity in hand is a renderable entity.
PublishOnlyRendered::onPrunePublishCdfEntities in modules/acquia_lift_publisher/src/EventSubscriber/Publish/PublishOnlyRendered.php
Removes cdfs that are not part of the personalized content scheme.

File

modules/acquia_lift_publisher/src/EventSubscriber/Publish/PublishOnlyRendered.php, line 157

Class

PublishOnlyRendered
Responsible for filtering contents based on publishing configurations.

Namespace

Drupal\acquia_lift_publisher\EventSubscriber\Publish

Code

private function getCdfEntityAttributeValue(CDFObject $cdf, string $attribute) {
  $attribute_obj = $cdf
    ->getAttribute($attribute);
  if (!$attribute_obj) {
    return NULL;
  }
  $attr_val = $attribute_obj
    ->getValue();
  return $attr_val[CDFObject::LANGUAGE_UNDETERMINED] ?? NULL;
}