public function Field::getString

Returns a string representation of the field.

Return value

string

Overrides TypedData::getString

File

drupal/core/lib/Drupal/Core/Entity/Field/Type/Field.php, line 108
Definition of Drupal\Core\Entity\Field\Type\Field.

Class

Field
An entity field, i.e. a list of field items.

Namespace

Drupal\Core\Entity\Field\Type

Code

public function getString() {
  $strings = array();
  foreach ($this
    ->list() as $item) {
    $strings[] = $item
      ->getString();
  }
  return implode(', ', array_filter($strings));
}