Commit c1027b9d authored by alexpott's avatar alexpott

Issue #2050835 by Berdir | yched: Move Widget, Formatter, and FieldType plugin...

Issue #2050835 by Berdir | yched: Move Widget, Formatter, and FieldType plugin types to the Core\Field system.
parent 784cebbe
......@@ -38,6 +38,13 @@ services:
factory_method: get
factory_service: cache_factory
arguments: [entity]
cache.field:
class: Drupal\Core\Cache\CacheBackendInterface
tags:
- { name: cache.bin }
factory_method: get
factory_service: cache_factory
arguments: [field]
cache.menu:
class: Drupal\Core\Cache\CacheBackendInterface
tags:
......@@ -163,9 +170,15 @@ services:
arguments: ['@container.namespaces', '@service_container', '@module_handler', '@cache.cache', '@language_manager', '@string_translation']
plugin.manager.entity:
alias: entity.manager
plugin.manager.entity.field.field_type:
class: Drupal\Core\Entity\Field\FieldTypePluginManager
arguments: ['@container.namespaces', '@cache.entity', '@language_manager', '@module_handler']
plugin.manager.field.field_type:
class: Drupal\Core\Field\FieldTypePluginManager
arguments: ['@container.namespaces', '@cache.field', '@language_manager', '@module_handler']
plugin.manager.field.widget:
class: Drupal\Core\Field\WidgetPluginManager
arguments: ['@container.namespaces', '@cache.field', '@module_handler', '@language_manager', '@plugin.manager.field.field_type']
plugin.manager.field.formatter:
class: Drupal\Core\Field\FormatterPluginManager
arguments: ['@container.namespaces', '@cache.field', '@module_handler', '@language_manager', '@plugin.manager.field.field_type']
plugin.manager.archiver:
class: Drupal\Core\Archiver\ArchiverManager
arguments: ['@container.namespaces', '@cache.cache', '@language_manager', '@module_handler']
......
......@@ -56,7 +56,7 @@ public function __construct($base_plugin_id, PluginManagerInterface $field_type_
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static(
$base_plugin_id,
$container->get('plugin.manager.entity.field.field_type')
$container->get('plugin.manager.field.field_type')
);
}
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field\Annotation\FieldFormatter.
* Contains \Drupal\Core\Field\Annotation\FieldFormatter.
*/
namespace Drupal\field\Annotation;
namespace Drupal\Core\Field\Annotation;
use Drupal\Component\Annotation\Plugin;
......@@ -21,8 +21,8 @@
*
* @Annotation
*
* @see \Drupal\field\Plugin\Type\Formatter\FormatterPluginManager
* @see \Drupal\field\Plugin\Type\Formatter\FormatterInterface
* @see \Drupal\Core\Field\FormatterPluginManager
* @see \Drupal\Core\Field\FormatterInterface
*/
class FieldFormatter extends Plugin {
......
......@@ -5,7 +5,7 @@
* Contains \Drupal\Core\Entity\Annotation\FieldType.
*/
namespace Drupal\Core\Entity\Annotation;
namespace Drupal\Core\Field\Annotation;
use Drupal\Core\TypedData\Annotation\DataType;
......
......@@ -5,7 +5,7 @@
* Contains \Drupal\field\Annotation\FieldWidget.
*/
namespace Drupal\field\Annotation;
namespace Drupal\Core\Field\Annotation;
use Drupal\Component\Annotation\Plugin;
......@@ -19,8 +19,8 @@
*
* @Annotation
*
* @see \Drupal\field\Plugin\Type\Widget\WidgetPluginManager
* @see \Drupal\field\Plugin\Type\Widget\WidgetInterface
* @see \Drupal\Core\Field\WidgetPluginManager
* @see \Drupal\Core\Field\WidgetInterface
*/
class FieldWidget extends Plugin {
......
......@@ -2,11 +2,10 @@
/**
* @file
*
* Contains \Drupal\Core\Entity\Field\FieldTypePluginManager.
* Contains \Drupal\Core\Field\FieldTypePluginManager.
*/
namespace Drupal\Core\Entity\Field;
namespace Drupal\Core\Field;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -41,7 +40,7 @@ class FieldTypePluginManager extends DefaultPluginManager {
* The module handler.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/field/field_type', $namespaces, 'Drupal\Core\Entity\Annotation\FieldType');
parent::__construct('Plugin/field/field_type', $namespaces, 'Drupal\Core\Field\Annotation\FieldType');
$this->alterInfo($module_handler, 'field_info');
$this->setCacheBackend($cache_backend, $language_manager, 'field_types_plugins');
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field\Plugin\Type\Formatter\FormatterBase.
* Contains \Drupal\Core\Field\FormatterBase.
*/
namespace Drupal\field\Plugin\Type\Formatter;
namespace Drupal\Core\Field;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field\Plugin\Type\Formatter\FormatterInterface.
* Contains \Drupal\Core\Field\FormatterInterface.
*/
namespace Drupal\field\Plugin\Type\Formatter;
namespace Drupal\Core\Field;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\PluginSettingsInterface;
......
......@@ -2,14 +2,13 @@
/**
* @file
* Definition of Drupal\field\Plugin\Type\Formatter\FormatterPluginManager..
* Contains \Drupal\Core\Field\FormatterPluginManager.
*/
namespace Drupal\field\Plugin\Type\Formatter;
namespace Drupal\Core\Field;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Entity\Field\FieldTypePluginManager;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageManager;
use Drupal\Core\Plugin\DefaultPluginManager;
......@@ -29,7 +28,7 @@ class FormatterPluginManager extends DefaultPluginManager {
/**
* The field type manager to define field.
*
* @var \Drupal\Core\Entity\Field\FieldTypePluginManager
* @var \Drupal\Core\Field\FieldTypePluginManager
*/
protected $fieldTypeManager;
......@@ -45,12 +44,12 @@ class FormatterPluginManager extends DefaultPluginManager {
* The module handler.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
* @param \Drupal\Core\Entity\Field\FieldTypePluginManager $field_type_manager
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
* The 'field type' plugin manager.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LanguageManager $language_manager, FieldTypePluginManager $field_type_manager) {
parent::__construct('Plugin/field/formatter', $namespaces, 'Drupal\field\Annotation\FieldFormatter');
parent::__construct('Plugin/Field/FieldFormatter', $namespaces, 'Drupal\Core\Field\Annotation\FieldFormatter');
$this->setCacheBackend($cache_backend, $language_manager, 'field_formatter_types_plugins');
$this->alterInfo($module_handler, 'field_formatter_info');
......@@ -66,7 +65,7 @@ public function createInstance($plugin_id, array $configuration) {
// @todo This is copied from \Drupal\Core\Plugin\Factory\ContainerFactory.
// Find a way to restore sanity to
// \Drupal\field\Plugin\Type\Formatter\FormatterBase::__construct().
// \Drupal\Core\Field\FormatterBase::__construct().
// If the plugin provides a factory method, pass the container to it.
if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
......@@ -96,7 +95,7 @@ public function createInstance($plugin_id, array $configuration) {
* - settings: (array) Settings specific to the formatter. Each setting
* defaults to the default value specified in the formatter definition.
*
* @return \Drupal\field\Plugin\Type\Formatter\FormatterInterface
* @return \Drupal\Core\Field\FormatterInterface
* A formatter object.
*/
public function getInstance(array $options) {
......
......@@ -2,15 +2,14 @@
/**
* @file
* Contains \Drupal\field\Plugin\Type\Widget\WidgetBase.
* Contains \Drupal\Core\Field\WidgetBase.
*/
namespace Drupal\field\Plugin\Type\Widget;
namespace Drupal\Core\Field;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\Plugin\PluginSettingsBase;
use Symfony\Component\Validator\ConstraintViolationInterface;
......@@ -374,7 +373,7 @@ public function flagErrors(FieldItemListInterface $items, array $form, array &$f
}
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
* {@inheritdoc}
*/
public function settingsForm(array $form, array &$form_state) {
return array();
......@@ -388,14 +387,14 @@ public function settingsSummary() {
}
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::errorElement().
* {@inheritdoc}
*/
public function errorElement(array $element, ConstraintViolationInterface $error, array $form, array &$form_state) {
return $element;
}
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::massageFormValues()
* {@inheritdoc}
*/
public function massageFormValues(array $values, array $form, array &$form_state) {
return $values;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Definition of Drupal\field\Plugin\Type\Widget\WidgetBaseInterface.
* Contains \Drupal\Core\Field\WidgetBaseInterface.
*/
namespace Drupal\field\Plugin\Type\Widget;
namespace Drupal\Core\Field;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\PluginSettingsInterface;
......@@ -14,8 +14,8 @@
* Base interface definition for "Field widget" plugins.
*
* This interface details base wrapping methods that most widget implementations
* will want to directly inherit from Drupal\field\Plugin\Type\Widget\WidgetBase.
* See Drupal\field\Plugin\Type\Widget\WidgetInterface for methods that will more
* will want to directly inherit from Drupal\Core\Field\WidgetBase.
* See Drupal\Core\Field\WidgetInterface for methods that will more
* likely be overriden.
*/
interface WidgetBaseInterface extends PluginSettingsInterface {
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\field\Plugin\WidgetFactory.
* Contains \Drupal\Core\Field\WidgetFactory.
*/
namespace Drupal\field\Plugin\Type\Widget;
namespace Drupal\Core\Field;
use Drupal\Component\Plugin\Factory\DefaultFactory;
......
......@@ -2,11 +2,12 @@
/**
* @file
* Definition of Drupal\field\Plugin\Type\Widget\WidgetInterface.
* Contains \Drupal\Core\Field\WidgetInterface.
*/
namespace Drupal\field\Plugin\Type\Widget;
namespace Drupal\Core\Field;
use Drupal\Core\Field\WidgetBaseInterface;
use Symfony\Component\Validator\ConstraintViolationInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
......@@ -14,9 +15,9 @@
* Interface definition for field widget plugins.
*
* This interface details the methods that most plugin implementations will want
* to override. See Drupal\field\Plugin\Type\Widget\WidgetBaseInterface for base
* to override. See Drupal\Core\Field\WidgetBaseInterface for base
* wrapping methods that should most likely be inherited directly from
* Drupal\field\Plugin\Type\Widget\WidgetBase..
* Drupal\Core\Field\WidgetBase..
*/
interface WidgetInterface extends WidgetBaseInterface {
......
......@@ -2,14 +2,13 @@
/**
* @file
* Definition of Drupal\field\Plugin\Type\Widget\WidgetPluginManager.
* Contains \Drupal\Core\Field\WidgetPluginManager.
*/
namespace Drupal\field\Plugin\Type\Widget;
namespace Drupal\Core\Field;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Entity\Field\FieldTypePluginManager;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageManager;
use Drupal\Core\Plugin\DefaultPluginManager;
......@@ -22,7 +21,7 @@ class WidgetPluginManager extends DefaultPluginManager {
/**
* The field type manager to define field.
*
* @var \Drupal\Core\Entity\Field\FieldTypePluginManager
* @var \Drupal\Core\Field\FieldTypePluginManager
*/
protected $fieldTypeManager;
......@@ -45,11 +44,11 @@ class WidgetPluginManager extends DefaultPluginManager {
* The module handler.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
* @param \Drupal\Core\Entity\Field\FieldTypePluginManager $field_type_manager
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
* The 'field type' plugin manager.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LanguageManager $language_manager, FieldTypePluginManager $field_type_manager) {
parent::__construct('Plugin/field/widget', $namespaces, 'Drupal\field\Annotation\FieldWidget');
parent::__construct('Plugin/Field/FieldWidget', $namespaces, 'Drupal\Core\Field\Annotation\FieldWidget');
$this->setCacheBackend($cache_backend, $language_manager, 'field_widget_types_plugins');
$this->alterInfo($module_handler, 'field_widget_info');
......@@ -76,7 +75,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
* - settings: (array) Settings specific to the widget. Each setting
* defaults to the default value specified in the widget definition.
*
* @return \Drupal\field\Plugin\Type\Widget\WidgetInterface
* @return \Drupal\Core\Field\WidgetInterface
* A Widget object.
*/
public function getInstance(array $options) {
......
......@@ -24,7 +24,7 @@
* as structured options arrays that can be used in an Options widget such as a
* select box or checkboxes.
*
* @see \Drupal\options\Plugin\field\widget\OptionsWidgetBase
* @see \Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase
*/
interface AllowedValuesInterface {
......
......@@ -2,17 +2,17 @@
/**
* @file
* Contains \Drupal\comment\Plugin\field\formatter\CommentDefaultFormatter.
* Contains \Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter.
*/
namespace Drupal\comment\Plugin\field\formatter;
namespace Drupal\comment\Plugin\Field\FieldFormatter;
use Drupal\comment\CommentStorageControllerInterface;
use Drupal\Core\Entity\EntityRenderControllerInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -2,13 +2,13 @@
/**
* @file
* Contains \Drupal\comment\Plugin\field\widget\CommentWidget.
* Contains \Drupal\comment\Plugin\Field\FieldWidget\CommentWidget.
*/
namespace Drupal\comment\Plugin\field\widget;
namespace Drupal\comment\Plugin\Field\FieldWidget;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\Type\Widget\WidgetBase;
use Drupal\Core\Field\WidgetBase;
/**
* Provides a default comment widget.
......
......@@ -171,7 +171,7 @@ function datetime_datelist_widget_validate(&$element, &$form_state) {
* Sets a default value for an empty date field.
*
* Callback for $instance['default_value_function'], as implemented by
* Drupal\datetime\Plugin\field\widget\DateTimeDatepicker.
* Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDatepicker.
*
* @param $entity_type
*
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\datetime\Plugin\field\formatter\DateTimeDefaultFormatter.
* Contains \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeDefaultFormatter.
*/
namespace Drupal\datetime\Plugin\field\formatter;
namespace Drupal\datetime\Plugin\Field\FieldFormatter;
use Drupal\Core\Datetime\Date;
use Drupal\Core\Datetime\DrupalDateTime;
......@@ -13,7 +13,7 @@
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
use Drupal\Core\Field\FormatterBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -2,12 +2,12 @@
/**
* @file
* Contains \Drupal\datetime\Plugin\field\formatter\DateTimePlainFormatter.
* Contains \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimePlainFormatter.
*/
namespace Drupal\datetime\Plugin\field\formatter;
namespace Drupal\datetime\Plugin\Field\FieldFormatter;
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Entity\Field\FieldItemListInterface;
/**
......
<?php
/**
* @file
* Contains \Drupal\datetime\Plugin\field\widget\DateTimeDatelistWidget.
* Contains \Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDatelistWidget.
*/
namespace Drupal\datetime\Plugin\field\widget;
namespace Drupal\datetime\Plugin\Field\FieldWidget;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\Type\Widget\WidgetBase;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\datetime\DateHelper;
......
<?php
/**
* @file
* Contains \Drupal\datetime\Plugin\field\widget\DateTimeDefaultWidget.
* Contains \Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDefaultWidget.
*/
namespace Drupal\datetime\Plugin\field\widget;
namespace Drupal\datetime\Plugin\Field\FieldWidget;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\Type\Widget\WidgetBase;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\field\FieldInstanceInterface;
......
......@@ -10,7 +10,7 @@
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
use Drupal\field\Plugin\Type\Formatter\FormatterPluginManager;
use Drupal\Core\Field\FormatterPluginManager;
/**
* Selects an in-place editor (an Editor plugin) for a field.
......@@ -27,7 +27,7 @@ class EditorSelector implements EditorSelectorInterface {
/**
* The manager for formatter plugins.
*
* @var \Drupal\field\Plugin\Type\Formatter\FormatterPluginManager.
* @var \Drupal\Core\Field\FormatterPluginManager.
*/
protected $formatterManager;
......@@ -43,7 +43,7 @@ class EditorSelector implements EditorSelectorInterface {
*
* @param \Drupal\Component\Plugin\PluginManagerInterface
* The manager for editor plugins.
* @param \Drupal\field\Plugin\Type\Formatter\FormatterPluginManager
* @param \Drupal\Core\Field\FormatterPluginManager
* The manager for formatter plugins.
*/
public function __construct(PluginManagerInterface $editor_manager, FormatterPluginManager $formatter_manager) {
......
......@@ -2,12 +2,12 @@
/**
* @file
* Definition of Drupal\email\Plugin\field\formatter\MailToFormatter.
* Contains \Drupal\email\Plugin\Field\FieldFormatter\MailToFormatter.
*/
namespace Drupal\email\Plugin\field\formatter;
namespace Drupal\email\Plugin\Field\FieldFormatter;
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Entity\Field\FieldItemListInterface;
/**
......@@ -24,7 +24,7 @@
class MailToFormatter extends FormatterBase {
/**
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items) {
$elements = array();
......
......@@ -2,13 +2,13 @@
/**
* @file
* Definition of Drupal\email\Plugin\field\widget\EmailDefaultWidget.
* Definition of Drupal\email\Plugin\Field\FieldWidget\EmailDefaultWidget.
*/
namespace Drupal\email\Plugin\field\widget;
namespace Drupal\email\Plugin\Field\FieldWidget;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\field\Plugin\Type\Widget\WidgetBase;
use Drupal\Core\Field\WidgetBase;
/**
* Plugin implementation of the 'email_default' widget.
......@@ -27,7 +27,7 @@
class EmailDefaultWidget extends WidgetBase {
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
* {@inheritdoc}
*/
public function settingsForm(array $form, array &$form_state) {
$element['placeholder'] = array(
......@@ -57,7 +57,7 @@ public function settingsSummary() {
}
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::formElement().
* {@inheritdoc}
*/
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
$element['value'] = $element + array(
......
......@@ -156,7 +156,7 @@ public function testFieldComponent() {
// Check that providing no options results in default values being used.
$display->setComponent($field_name);
$field_type_info = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->type);
$field_type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
$default_formatter = $field_type_info['default_formatter'];
$formatter_settings = \Drupal::service('plugin.manager.field.formatter')->getDefinition($default_formatter);
$expected = array(
......
......@@ -78,7 +78,7 @@ public function testFieldComponent() {
// Check that providing no options results in default values being used.
$form_display->setComponent($field_name);
$field_type_info = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->type);
$field_type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
$default_widget = $field_type_info['default_widget'];
$widget_settings = \Drupal::service('plugin.manager.field.widget')->getDefinition($default_widget);
$expected = array(
......
......@@ -223,7 +223,7 @@ function entity_reference_query_entity_reference_alter(AlterableInterface $query
*/
function entity_reference_create_instance($entity_type, $bundle, $field_name, $field_label, $target_entity_type, $selection_handler = 'default', $selection_handler_settings = array()) {
// If a field type we know should exist isn't found, clear the field cache.
if (!\Drupal::service('plugin.manager.entity.field.field_type')->getDefinition('entity_reference')) {
if (!\Drupal::service('plugin.manager.field.field_type')->getDefinition('entity_reference')) {
field_cache_clear();
}
......
......@@ -2,14 +2,13 @@
/**
* @file
* Contains \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceEntityFormatter.
* Contains \Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter.
*/
namespace Drupal\entity_reference\Plugin\field\formatter;
namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\entity_reference\RecursiveRenderingException;
use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
/**
* Plugin implementation of the 'entity reference rendered entity' formatter.
......
......@@ -2,12 +2,12 @@
/**
* @file
* Contains \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase.
* Contains \Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase.
*/
namespace Drupal\entity_reference\Plugin\field\formatter;
namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
use Drupal\Core\Field\FormatterBase;
/**
* Parent plugin for entity reference formatters.
......@@ -15,7 +15,7 @@
abstract class EntityReferenceFormatterBase extends FormatterBase {
/**
* Overrides \Drupal\field\Plugin\Type\Formatter\FormatterBase::prepareView().
* {@inheritdoc}
*
* Mark the accessible IDs a user can see. We do not unset unaccessible
* values, as other may want to act on those values, even if they can
......