You are here

public function ContentEntityCdfNormalizer::appendToAttribute in Acquia Content Hub 8

Append to existing values of Content Hub Attribute.

Parameters

\Acquia\ContentHubClient\Attribute $attribute: The attribute.

array $values: The attribute's values.

1 call to ContentEntityCdfNormalizer::appendToAttribute()
ContentEntityCdfNormalizer::addFieldsToContentHubEntity in src/Normalizer/ContentEntityCdfNormalizer.php
Get fields from given entity.

File

src/Normalizer/ContentEntityCdfNormalizer.php, line 988

Class

ContentEntityCdfNormalizer
Converts the Drupal entity object to a Acquia Content Hub CDF array.

Namespace

Drupal\acquia_contenthub\Normalizer

Code

public function appendToAttribute(Attribute $attribute, array $values) {
  $old_values = $attribute
    ->getValues();
  $values = array_merge($old_values, $values);
  $attribute
    ->setValues($values);
}