You are here

public function TextimageFactory::getTextFieldText in Textimage 8.4

Same name and namespace in other branches
  1. 8.3 src/TextimageFactory.php \Drupal\textimage\TextimageFactory::getTextFieldText()

Retrieves text from a Text field.

Parameters

Drupal\Core\Field\FieldItemListInterface $items: Field items.

Return value

array An array of sanitized text items.

Overrides TextimageFactoryInterface::getTextFieldText

1 call to TextimageFactory::getTextFieldText()
TextimageFactory::processTokens in src/TextimageFactory.php
Textimage tokens replacement.

File

src/TextimageFactory.php, line 527

Class

TextimageFactory
Provides a factory for Textimage.

Namespace

Drupal\textimage

Code

public function getTextFieldText(FieldItemListInterface $items) {
  $text = [];
  foreach ($items as $item) {
    $value = $item
      ->getValue();
    $text[] = !empty($value['value']) ? $value['value'] : '';
  }
  return $text;
}