AddressFieldBuilder.php in Address 8
File
src/Plugin/diff/Field/AddressFieldBuilder.php
View source
<?php
namespace Drupal\address\Plugin\diff\Field;
use Drupal\diff\Plugin\diff\Field\CoreFieldBuilder;
use Drupal\Core\Field\FieldItemListInterface;
class AddressFieldBuilder extends CoreFieldBuilder {
public function build(FieldItemListInterface $field_items) {
$result = [];
foreach ($field_items as $field_key => $field_item) {
if (!$field_item
->isEmpty()) {
$value = $field_item
->view([
'label' => 'hidden',
'type' => 'address_plain',
]);
$rendered_value = $this->renderer
->renderPlain($value);
$result[$field_key][] = $rendered_value;
}
}
return $result;
}
}