FlaggedEntityFieldItemList.php in Flag 8.4
Namespace
Drupal\flag\Plugin\FieldFile
src/Plugin/Field/FlaggedEntityFieldItemList.phpView source
<?php
namespace Drupal\flag\Plugin\Field;
use Drupal\Core\Field\EntityReferenceFieldItemList;
use Drupal\Core\TypedData\ComputedItemListTrait;
/**
* A computed entity reference field item list.
*/
class FlaggedEntityFieldItemList extends EntityReferenceFieldItemList {
use ComputedItemListTrait;
/**
* Returns the label as the field item.
*/
protected function computeValue() {
$this->list[0] = $this
->createItem(0, $this
->getEntity()->value);
}
}
Classes
Name![]() |
Description |
---|---|
FlaggedEntityFieldItemList | A computed entity reference field item list. |