Issue #2050835 by Berdir | yched: Move Widget, Formatter, and FieldType plugin types to the Core\Field system.
parent
784cebbe5a
commit
c1027b9d1a
|
|
@ -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 @@ class FieldItemDeriver implements ContainerDerivativeInterface {
|
|||
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 @@ use Drupal\Component\Annotation\Plugin;
|
|||
*
|
||||
* @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 @@ use Drupal\Component\Annotation\Plugin;
|
|||
*
|
||||
* @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 @@ class FormatterPluginManager extends DefaultPluginManager {
|
|||
|
||||
// @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 @@ class FormatterPluginManager extends DefaultPluginManager {
|
|||
* - 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 @@ abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function settingsForm(array $form, array &$form_state) {
|
||||
return array();
|
||||
|
|
@ -388,14 +387,14 @@ abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 @@ use Drupal\field\Plugin\PluginSettingsInterface;
|
|||
* 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 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
* 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 @@ class WidgetPluginManager extends DefaultPluginManager {
|
|||
* - 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 @@ use Drupal\Core\Session\AccountInterface;
|
|||
* 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\EntityStorageControllerInterface;
|
|||
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;
|
||||
|
||||
/**
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<?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;
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<?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 @@ namespace Drupal\edit;
|
|||
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 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
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 @@ use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
|||
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 @@ class EmailDefaultWidget extends WidgetBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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 @@ class EntityDisplayTest extends DrupalUnitTestBase {
|
|||
|
||||
// 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 @@ class EntityFormDisplayTest extends DrupalUnitTestBase {
|
|||
|
||||
// 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 @@ use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
|||
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
|
||||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceIdFormatter.
|
||||
* Contains \Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceIdFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity_reference\Plugin\field\formatter;
|
||||
namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'entity reference ID' formatter.
|
||||
|
|
@ -25,7 +24,7 @@ use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
|
|||
class EntityReferenceIdFormatter extends EntityReferenceFormatterBase {
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceLabelFormatter.
|
||||
* Contains \Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceLabelFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity_reference\Plugin\field\formatter;
|
||||
namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'entity reference label' formatter.
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\entity_reference\Plugin\field\widget\AutocompleteTagsWidget.
|
||||
* Contains \Drupal\entity_reference\Plugin\Field\FieldWidget\AutocompleteTagsWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity_reference\Plugin\field\widget;
|
||||
namespace Drupal\entity_reference\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\entity_reference\Plugin\field\widget\AutocompleteWidgetBase;
|
||||
use Drupal\entity_reference\Plugin\Field\FieldWidget\AutocompleteWidgetBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'entity_reference autocomplete-tags' widget.
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\entity_reference\Plugin\field\widget\AutocompleteWidget.
|
||||
* Contains \Drupal\entity_reference\Plugin\Field\FieldWidget\AutocompleteWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity_reference\Plugin\field\widget;
|
||||
namespace Drupal\entity_reference\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\entity_reference\Plugin\field\widget\AutocompleteWidgetBase;
|
||||
use Drupal\entity_reference\Plugin\Field\FieldWidget\AutocompleteWidgetBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'entity_reference autocomplete' widget.
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\entity_reference\Plugin\field\widget\AutocompleteWidgetBase.
|
||||
* Contains \Drupal\entity_reference\Plugin\Field\FieldWidget\AutocompleteWidgetBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity_reference\Plugin\field\widget;
|
||||
namespace Drupal\entity_reference\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -59,7 +59,7 @@ interface SelectionInterface {
|
|||
* @return integer|null
|
||||
* Value of a matching entity ID, or NULL if none.
|
||||
*
|
||||
* @see \Drupal\entity_reference\Plugin\field\widget::elementValidate()
|
||||
* @see \Drupal\entity_reference\Plugin\Field\FieldWidget::elementValidate()
|
||||
*/
|
||||
public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -153,10 +153,10 @@ function hook_field_info_alter(&$info) {
|
|||
* which widget to use.
|
||||
*
|
||||
* Widgets are Plugins managed by the
|
||||
* Drupal\field\Plugin\Type\Widget\WidgetPluginManager class. A widget is
|
||||
* Drupal\Core\Field\WidgetPluginManager class. A widget is
|
||||
* implemented by providing a class that implements
|
||||
* Drupal\field\Plugin\Type\Widget\WidgetInterface (in most cases, by
|
||||
* subclassing Drupal\field\Plugin\Type\Widget\WidgetBase), and provides the
|
||||
* Drupal\Core\Field\WidgetInterface (in most cases, by
|
||||
* subclassing Drupal\Core\Field\WidgetBase), and provides the
|
||||
* proper annotation block.
|
||||
*
|
||||
* Widgets are @link forms_api_reference.html Form API @endlink
|
||||
|
|
@ -204,7 +204,7 @@ function hook_field_widget_info_alter(array &$info) {
|
|||
* - default: A boolean indicating whether the form is being shown as a dummy
|
||||
* form to set default values.
|
||||
*
|
||||
* @see \Drupal\field\Plugin\Type\Widget\WidgetBase::formSingleElement()
|
||||
* @see \Drupal\Core\Field\WidgetBase::formSingleElement()
|
||||
* @see hook_field_widget_WIDGET_TYPE_form_alter()
|
||||
*/
|
||||
function hook_field_widget_form_alter(&$element, &$form_state, $context) {
|
||||
|
|
@ -231,7 +231,7 @@ function hook_field_widget_form_alter(&$element, &$form_state, $context) {
|
|||
* An associative array. See hook_field_widget_form_alter() for the structure
|
||||
* and content of the array.
|
||||
*
|
||||
* @see \Drupal\field\Plugin\Type\Widget\WidgetBase::formSingleElement()
|
||||
* @see \Drupal\Core\Field\WidgetBase::formSingleElement()
|
||||
* @see hook_field_widget_form_alter()
|
||||
*/
|
||||
function hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $context) {
|
||||
|
|
@ -258,10 +258,10 @@ function hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $cont
|
|||
* choose which formatter to use.
|
||||
*
|
||||
* Formatters are Plugins managed by the
|
||||
* Drupal\field\Plugin\Type\Formatter\FormatterPluginManager class. A formatter
|
||||
* Drupal\Core\Field\FormatterPluginManager class. A formatter
|
||||
* is implemented by providing a class that implements
|
||||
* Drupal\field\Plugin\Type\Formatter\FormatterInterface (in most cases, by
|
||||
* subclassing Drupal\field\Plugin\Type\Formatter\FormatterBase), and provides
|
||||
* Drupal\Core\Field\FormatterInterface (in most cases, by
|
||||
* subclassing Drupal\Core\Field\FormatterBase), and provides
|
||||
* the proper annotation block.
|
||||
*
|
||||
* @see field
|
||||
|
|
|
|||
|
|
@ -22,16 +22,16 @@ use Drupal\field\Field;
|
|||
* keyed by field type name.
|
||||
*
|
||||
* @deprecated as of Drupal 8.0. Use
|
||||
* \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition()
|
||||
* \Drupal::service('plugin.manager.field.field_type')->getDefinition()
|
||||
* or
|
||||
* \Drupal::service('plugin.manager.entity.field.field_type')->getConfigurableDefinitions().
|
||||
* \Drupal::service('plugin.manager.field.field_type')->getConfigurableDefinitions().
|
||||
*/
|
||||
function field_info_field_types($field_type = NULL) {
|
||||
if ($field_type) {
|
||||
return \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field_type);
|
||||
return \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_type);
|
||||
}
|
||||
else {
|
||||
return \Drupal::service('plugin.manager.entity.field.field_type')->getConfigurableDefinitions();
|
||||
return \Drupal::service('plugin.manager.field.field_type')->getConfigurableDefinitions();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,10 +46,10 @@ function field_info_field_types($field_type = NULL) {
|
|||
* are not defined.
|
||||
*
|
||||
* @deprecated as of Drupal 8.0. Use
|
||||
* \Drupal::service('plugin.manager.entity.field.field_type')->getDefaultSettings()
|
||||
* \Drupal::service('plugin.manager.field.field_type')->getDefaultSettings()
|
||||
*/
|
||||
function field_info_field_settings($type) {
|
||||
return \Drupal::service('plugin.manager.entity.field.field_type')->getDefaultSettings($type);
|
||||
return \Drupal::service('plugin.manager.field.field_type')->getDefaultSettings($type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,10 +63,10 @@ function field_info_field_settings($type) {
|
|||
* settings are not defined.
|
||||
*
|
||||
* @deprecated as of Drupal 8.0. Use
|
||||
* \Drupal::service('plugin.manager.entity.field.field_type')->getDefaultInstanceSettings()
|
||||
* \Drupal::service('plugin.manager.field.field_type')->getDefaultInstanceSettings()
|
||||
*/
|
||||
function field_info_instance_settings($type) {
|
||||
return \Drupal::service('plugin.manager.entity.field.field_type')->getDefaultInstanceSettings($type);
|
||||
return \Drupal::service('plugin.manager.field.field_type')->getDefaultInstanceSettings($type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function field_info_cache_clear() {
|
|||
|
||||
// Clear typed data definitions.
|
||||
\Drupal::typedData()->clearCachedDefinitions();
|
||||
\Drupal::service('plugin.manager.entity.field.field_type')->clearCachedDefinitions();
|
||||
\Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions();
|
||||
|
||||
Field::fieldInfo()->flush();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ function field_help($path, $arg) {
|
|||
$items = array();
|
||||
$info = system_get_info('module');
|
||||
$field_widgets = \Drupal::service('plugin.manager.field.widget')->getDefinitions();
|
||||
$field_types = \Drupal::service('plugin.manager.entity.field.field_type')->getConfigurableDefinitions();
|
||||
$field_types = \Drupal::service('plugin.manager.field.field_type')->getConfigurableDefinitions();
|
||||
foreach (array_merge($field_types, $field_widgets) as $plugin) {
|
||||
$providers[] = $plugin['provider'];
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ function field_sync_field_status() {
|
|||
// modules.
|
||||
$changed = array();
|
||||
$modules = $module_handler->getModuleList();
|
||||
$field_types = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinitions();
|
||||
$field_types = \Drupal::service('plugin.manager.field.field_type')->getDefinitions();
|
||||
// Set fields with missing field type modules to inactive.
|
||||
foreach ($fields as $uuid => &$field) {
|
||||
// Associate field types.
|
||||
|
|
|
|||
|
|
@ -1,17 +1,5 @@
|
|||
services:
|
||||
plugin.manager.field.widget:
|
||||
class: Drupal\field\Plugin\Type\Widget\WidgetPluginManager
|
||||
arguments: ['@container.namespaces', '@cache.field', '@module_handler', '@language_manager', '@plugin.manager.entity.field.field_type']
|
||||
plugin.manager.field.formatter:
|
||||
class: Drupal\field\Plugin\Type\Formatter\FormatterPluginManager
|
||||
arguments: ['@container.namespaces', '@cache.field', '@module_handler', '@language_manager', '@plugin.manager.entity.field.field_type']
|
||||
field.info:
|
||||
class: Drupal\field\FieldInfo
|
||||
arguments: ['@cache.field', '@config.factory', '@module_handler', '@plugin.manager.entity.field.field_type']
|
||||
cache.field:
|
||||
class: Drupal\Core\Cache\CacheBackendInterface
|
||||
tags:
|
||||
- { name: cache.bin }
|
||||
factory_method: get
|
||||
factory_service: cache_factory
|
||||
arguments: [field]
|
||||
arguments: ['@cache.field', '@config.factory', '@module_handler', '@plugin.manager.field.field_type']
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ function field_views_field_default_views_data(FieldInterface $field) {
|
|||
$data = array();
|
||||
|
||||
// Check the field type is available.
|
||||
if (!\Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->getFieldType())) {
|
||||
if (!\Drupal::service('plugin.manager.field.field_type')->getDefinition($field->getFieldType())) {
|
||||
return $data;
|
||||
}
|
||||
// Check the field has instances.
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ class Field extends ConfigEntityBase implements FieldInterface {
|
|||
}
|
||||
|
||||
// Check that the field type is known.
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->type);
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->type);
|
||||
if (!$field_type) {
|
||||
throw new FieldException(format_string('Attempt to create a field of unknown type %type.', array('%type' => $this->type)));
|
||||
}
|
||||
|
|
@ -455,7 +455,7 @@ class Field extends ConfigEntityBase implements FieldInterface {
|
|||
public function getSchema() {
|
||||
if (!isset($this->schema)) {
|
||||
// Get the schema from the field item class.
|
||||
$definition = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->type);
|
||||
$definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->type);
|
||||
$class = $definition['class'];
|
||||
$schema = $class::schema($this);
|
||||
// Fill in default values for optional entries.
|
||||
|
|
@ -525,7 +525,7 @@ class Field extends ConfigEntityBase implements FieldInterface {
|
|||
// maintains its own static cache. However, do some CPU and memory
|
||||
// profiling to see if it's worth statically caching $field_type_info, or
|
||||
// the default field and instance settings, within $this.
|
||||
$field_type_info = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->type);
|
||||
$field_type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->type);
|
||||
|
||||
$settings = $this->settings + $field_type_info['settings'] + $field_type_info['instance_settings'];
|
||||
return $settings;
|
||||
|
|
@ -536,7 +536,7 @@ class Field extends ConfigEntityBase implements FieldInterface {
|
|||
*/
|
||||
public function getFieldSetting($setting_name) {
|
||||
// @todo See getFieldSettings() about potentially statically caching this.
|
||||
$field_type_info = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->type);
|
||||
$field_type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->type);
|
||||
|
||||
// We assume here that consecutive array_key_exists() is more efficient than
|
||||
// calling getFieldSettings() when all we need is a single setting.
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ class FieldInstance extends ConfigEntityBase implements FieldInstanceInterface {
|
|||
* Prepares the instance definition for saving.
|
||||
*/
|
||||
protected function prepareSave() {
|
||||
$field_type_info = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->field->type);
|
||||
$field_type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->field->type);
|
||||
|
||||
// Set the default instance settings.
|
||||
$this->settings += $field_type_info['instance_settings'];
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Drupal\field;
|
|||
|
||||
use Drupal\Core\Cache\CacheBackendInterface;
|
||||
use Drupal\Core\Config\ConfigFactory;
|
||||
use Drupal\Core\Entity\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Drupal\field\FieldInterface;
|
||||
use Drupal\field\FieldInstanceInterface;
|
||||
|
|
@ -50,7 +50,7 @@ class FieldInfo {
|
|||
/**
|
||||
* The field type manager to define field.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\Field\FieldTypePluginManager
|
||||
* @var \Drupal\Core\Field\FieldTypePluginManager
|
||||
*/
|
||||
protected $fieldTypeManager;
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ class FieldInfo {
|
|||
* The configuration factory object to use.
|
||||
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
|
||||
* The module handler class to use for invoking hooks.
|
||||
* @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(CacheBackendInterface $cache_backend, ConfigFactory $config, ModuleHandlerInterface $module_handler, FieldTypePluginManager $field_type_manager) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class ConfigEntityReferenceItemBase extends EntityReferenceItem implements Confi
|
|||
* since we cannot extend it.
|
||||
*/
|
||||
public static function schema(FieldInterface $field) {
|
||||
$definition = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->type);
|
||||
$definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
|
||||
$module = $definition['provider'];
|
||||
module_load_install($module);
|
||||
$callback = "{$module}_field_schema";
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class ConfigFieldItemList extends FieldItemList implements ConfigFieldItemListIn
|
|||
* @param array $form_state
|
||||
* The form state of the (entire) configuration form.
|
||||
*
|
||||
* @return \Drupal\field\Plugin\Type\Widget\WidgetInterface
|
||||
* @return \Drupal\Core\Field\WidgetInterface
|
||||
* A Widget object.
|
||||
*/
|
||||
protected function defaultValueWidget(array &$form_state) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ abstract class LegacyConfigFieldItem extends ConfigFieldItemBase implements Prep
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public static function schema(FieldInterface $field) {
|
||||
$definition = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->type);
|
||||
$definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
|
||||
$module = $definition['provider'];
|
||||
module_load_install($module);
|
||||
$callback = "{$module}_field_schema";
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityInterface;
|
|||
use Drupal\Core\Entity\EntityStorageControllerInterface;
|
||||
use Drupal\Core\Language\Language;
|
||||
use Drupal\Core\Entity\EntityManager;
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterPluginManager;
|
||||
use Drupal\Core\Field\FormatterPluginManager;
|
||||
use Drupal\views\ViewExecutable;
|
||||
use Drupal\views\Plugin\views\display\DisplayPluginBase;
|
||||
use Drupal\views\Plugin\views\field\FieldPluginBase;
|
||||
|
|
@ -81,7 +81,7 @@ class Field extends FieldPluginBase {
|
|||
/**
|
||||
* The field formatter plugin manager.
|
||||
*
|
||||
* @var \Drupal\field\Plugin\Type\Formatter\FormatterPluginManager
|
||||
* @var \Drupal\Core\Field\FormatterPluginManager
|
||||
*/
|
||||
protected $formatterPluginManager;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ class Field extends FieldPluginBase {
|
|||
* The plugin implementation definition.
|
||||
* @param \Drupal\Core\Entity\EntityManager $entity_manager
|
||||
* The field formatter plugin manager.
|
||||
* @param \Drupal\field\Plugin\Type\Formatter\FormatterPluginManager $formatter_plugin_manager
|
||||
* @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager
|
||||
* The field formatter plugin manager.
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManager $entity_manager, FormatterPluginManager $formatter_plugin_manager) {
|
||||
|
|
@ -316,7 +316,7 @@ class Field extends FieldPluginBase {
|
|||
|
||||
// defineOptions runs before init/construct, so no $this->field_info
|
||||
$field = field_info_field($this->definition['entity_type'], $this->definition['field_name']);
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field->getFieldType());
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->getFieldType());
|
||||
$column_names = array_keys($field->getColumns());
|
||||
$default_column = '';
|
||||
// Try to determine a sensible default.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class CrudTest extends FieldUnitTestBase {
|
|||
$this->assertEqual($field_config['cardinality'], 1, 'Cardinality defaults to 1.');
|
||||
|
||||
// Ensure that default settings are present.
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field_definition['type']);
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition['type']);
|
||||
$this->assertEqual($field_config['settings'], $field_type['settings'], 'Default field settings have been written.');
|
||||
|
||||
// Guarantee that the name is unique.
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ class DisplayApiTest extends FieldUnitTestBase {
|
|||
* Tests that the prepareView() formatter method still fires for empty values.
|
||||
*/
|
||||
function testFieldEmpty() {
|
||||
// Uses \Drupal\field_test\Plugin\field\formatter\TestFieldEmptyFormatter.
|
||||
// Uses \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldEmptyFormatter.
|
||||
$display = array(
|
||||
'label' => 'hidden',
|
||||
'type' => 'field_empty_test',
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class FieldHelpTest extends WebTestBase {
|
|||
// Enable the Options, E-mail and Field API Test modules.
|
||||
\Drupal::moduleHandler()->install(array('options', 'email', 'field_test'));
|
||||
\Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
|
||||
\Drupal::service('plugin.manager.entity.field.field_type')->clearCachedDefinitions();
|
||||
\Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions();
|
||||
|
||||
$this->drupalGet('admin/help/field');
|
||||
$this->assertLink('Options', 0, 'Options module is listed on the Field help page.');
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class FieldInfoTest extends FieldUnitTestBase {
|
|||
// Test that field_test module's fields, widgets, and formatters show up.
|
||||
|
||||
$field_test_info = $this->getExpectedFieldTypeDefinition();
|
||||
$info = \Drupal::service('plugin.manager.entity.field.field_type')->getConfigurableDefinitions();
|
||||
$info = \Drupal::service('plugin.manager.field.field_type')->getConfigurableDefinitions();
|
||||
foreach ($field_test_info as $t_key => $field_type) {
|
||||
foreach ($field_type as $key => $val) {
|
||||
$this->assertEqual($info[$t_key][$key], $val, format_string('Field type %t_key key %key is %value', array('%t_key' => $t_key, '%key' => $key, '%value' => print_r($val, TRUE))));
|
||||
|
|
@ -132,7 +132,7 @@ class FieldInfoTest extends FieldUnitTestBase {
|
|||
$field = field_info_field('entity_test', $field_definition['name']);
|
||||
|
||||
// Check that all expected settings are in place.
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field_definition['type']);
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition['type']);
|
||||
$this->assertEqual($field->settings, $field_type['settings'], 'All expected default field settings are present.');
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ class FieldInfoTest extends FieldUnitTestBase {
|
|||
$instance = field_info_instance($instance_definition['entity_type'], $instance_definition['field_name'], $instance_definition['bundle']);
|
||||
|
||||
// Check that all expected instance settings are in place.
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field_definition['type']);
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition['type']);
|
||||
$this->assertEqual($instance->settings, $field_type['instance_settings'] , 'All expected instance settings are present.');
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ class FieldInfoTest extends FieldUnitTestBase {
|
|||
function testSettingsInfo() {
|
||||
$info = $this->getExpectedFieldTypeDefinition();
|
||||
foreach ($info as $type => $data) {
|
||||
$field_type_manager = \Drupal::service('plugin.manager.entity.field.field_type');
|
||||
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
|
||||
$this->assertIdentical($field_type_manager->getDefaultSettings($type), $data['settings'], format_string("field settings service returns %type's field settings", array('%type' => $type)));
|
||||
$this->assertIdentical($field_type_manager->getDefaultInstanceSettings($type), $data['instance_settings'], format_string("field instance settings service returns %type's field instance settings", array('%type' => $type)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class FieldInstanceCrudTest extends FieldUnitTestBase {
|
|||
// applied on write.
|
||||
$config = \Drupal::config('field.instance.' . $instance->id())->get();
|
||||
|
||||
$field_type = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($this->field_definition['type']);
|
||||
$field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->field_definition['type']);
|
||||
|
||||
// Check that default values are set.
|
||||
$this->assertEqual($config['required'], FALSE, 'Required defaults to false.');
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\field_test\Plugin\field\formatter\TestFieldDefaultFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\formatter;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
*
|
||||
* Contains \Drupal\field_test\Plugin\field\formatter\TestFieldEmptyFormatter.
|
||||
*/
|
||||
namespace Drupal\field_test\Plugin\field\formatter;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'field_empty_test' formatter.
|
||||
|
|
@ -5,11 +5,9 @@
|
|||
* Contains \Drupal\field_test\Plugin\field\formatter\TestFieldEmptySettingFormatter
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\formatter;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Annotation\FieldFormatter;
|
||||
use Drupal\Core\Annotation\Translation;
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\field_test\Plugin\field\formatter\TestFieldMultipleFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\formatter;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\field_test\Plugin\field\formatter\TestFieldPrepareViewFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\formatter;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\field_test\Plugin\field\widget\TestFieldWidget.
|
||||
* Definition of Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\widget;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\field_test\Plugin\field\widget\TestFieldWidgetMultiple.
|
||||
* Definition of Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidgetMultiple.
|
||||
*/
|
||||
|
||||
namespace Drupal\field_test\Plugin\field\widget;
|
||||
namespace Drupal\field_test\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -23,7 +23,7 @@ class DisplayOverview extends DisplayOverviewBase {
|
|||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('entity.manager'),
|
||||
$container->get('plugin.manager.entity.field.field_type'),
|
||||
$container->get('plugin.manager.field.field_type'),
|
||||
$container->get('plugin.manager.field.formatter')
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Drupal\field_ui;
|
|||
|
||||
use Drupal\Component\Plugin\PluginManagerBase;
|
||||
use Drupal\Core\Entity\EntityManager;
|
||||
use Drupal\Core\Entity\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Field\FieldTypePluginManager;
|
||||
use Drupal\entity\EntityDisplayBaseInterface;
|
||||
use Drupal\field\FieldInstanceInterface;
|
||||
use Drupal\field_ui\OverviewBase;
|
||||
|
|
@ -39,7 +39,7 @@ abstract class DisplayOverviewBase extends OverviewBase {
|
|||
*
|
||||
* @param \Drupal\Core\Entity\EntityManager $entity_manager
|
||||
* The entity manager.
|
||||
* @param \Drupal\Core\Entity\Field\FieldTypePluginManager $field_type_manager
|
||||
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
|
||||
* The field type manager.
|
||||
* @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
|
||||
* The widget or formatter plugin manager.
|
||||
|
|
@ -57,7 +57,7 @@ abstract class DisplayOverviewBase extends OverviewBase {
|
|||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('entity.manager'),
|
||||
$container->get('plugin.manager.entity.field.field_type'),
|
||||
$container->get('plugin.manager.field.field_type'),
|
||||
$container->get('plugin.manager.field.widget')
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Drupal\field_ui;
|
|||
use Drupal\Core\Config\Entity\ConfigEntityListController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityManager;
|
||||
use Drupal\Core\Entity\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ class FieldListController extends ConfigEntityListController {
|
|||
/**
|
||||
* The field type manager.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\Field\FieldTypePluginManager
|
||||
* @var \Drupal\Core\Field\FieldTypePluginManager
|
||||
*/
|
||||
protected $fieldTypeManager;
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ class FieldListController extends ConfigEntityListController {
|
|||
* The module handler to invoke hooks on.
|
||||
* @param \Drupal\field\FieldInfo $field_info
|
||||
* The field info service.
|
||||
* @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($entity_type, array $entity_info, EntityManager $entity_manager, ModuleHandlerInterface $module_handler, FieldTypePluginManager $field_type_manager) {
|
||||
|
|
@ -81,7 +81,7 @@ class FieldListController extends ConfigEntityListController {
|
|||
$entity_info,
|
||||
$container->get('entity.manager'),
|
||||
$container->get('module_handler'),
|
||||
$container->get('plugin.manager.entity.field.field_type')
|
||||
$container->get('plugin.manager.field.field_type')
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
namespace Drupal\field_ui;
|
||||
|
||||
use Drupal\Core\Entity\EntityManager;
|
||||
use Drupal\Core\Entity\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Field\FieldTypePluginManager;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Drupal\field_ui\OverviewBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
|
@ -22,7 +22,7 @@ class FieldOverview extends OverviewBase {
|
|||
/**
|
||||
* The field type manager.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\Field\FieldTypePluginManager
|
||||
* @var \Drupal\Core\Field\FieldTypePluginManager
|
||||
*/
|
||||
protected $fieldTypeManager;
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class FieldOverview extends OverviewBase {
|
|||
*
|
||||
* @param \Drupal\Core\Entity\EntityManager $entity_manager
|
||||
* The entity manager.
|
||||
* @param \Drupal\Core\Entity\Field\FieldTypePluginManager $field_type_manager
|
||||
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
|
||||
* The field type manager
|
||||
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
|
||||
* The module handler to invoke hooks on.
|
||||
|
|
@ -55,7 +55,7 @@ class FieldOverview extends OverviewBase {
|
|||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('entity.manager'),
|
||||
$container->get('plugin.manager.entity.field.field_type'),
|
||||
$container->get('plugin.manager.field.field_type'),
|
||||
$container->get('module_handler')
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class FormDisplayOverview extends DisplayOverviewBase {
|
|||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('entity.manager'),
|
||||
$container->get('plugin.manager.entity.field.field_type'),
|
||||
$container->get('plugin.manager.field.field_type'),
|
||||
$container->get('plugin.manager.field.widget')
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ class ManageFieldsTest extends FieldUiTestBase {
|
|||
$this->assertFalse($this->xpath('//select[@id="edit-add-existing-field-field-name"]//option[@value=:field_name]', array(':field_name' => $field_name)), "The 're-use existing field' select respects field types 'no_ui' property.");
|
||||
|
||||
// Check that non-configurable fields are not available.
|
||||
$field_types = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinitions();
|
||||
$field_types = \Drupal::service('plugin.manager.field.field_type')->getDefinitions();
|
||||
foreach ($field_types as $field_type => $definition) {
|
||||
if ($definition['configurable'] && empty($definition['no_ui'])) {
|
||||
$this->assertTrue($this->xpath('//select[@id="edit-fields-add-new-field-type"]//option[@value=:field_type]', array(':field_type' => $field_type)), String::format('Configurable field type @field_type is available.', array('@field_type' => $field_type)));
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\file\Plugin\field\formatter\FileFormatterBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\formatter;
|
||||
namespace Drupal\file\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
|
||||
/**
|
||||
* Base class for file formatters.
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
* Contains \Drupal\file\Plugin\field\formatter\GenericFileFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\formatter;
|
||||
namespace Drupal\file\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
class GenericFileFormatter extends FileFormatterBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
* Contains \Drupal\file\Plugin\field\formatter\RSSEnclosureFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\formatter;
|
||||
namespace Drupal\file\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
class RSSEnclosureFormatter extends FileFormatterBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$entity = $items->getEntity();
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
* Contains \Drupal\file\Plugin\field\formatter\TableFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\formatter;
|
||||
namespace Drupal\file\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
class TableFormatter extends FileFormatterBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
* Contains \Drupal\file\Plugin\field\formatter\UrlPlainFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\formatter;
|
||||
namespace Drupal\file\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
class UrlPlainFormatter extends FileFormatterBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\file\Plugin\field\widget\FileWidget.
|
||||
* Contains \Drupal\file\Plugin\Field\FieldWidget\FileWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\file\Plugin\field\widget;
|
||||
namespace Drupal\file\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +55,7 @@ class FileWidget extends WidgetBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\field\Plugin\Type\Widget\WidgetBase::formMultipleElements().
|
||||
* Overrides \Drupal\Core\Field\WidgetBase::formMultipleElements().
|
||||
*
|
||||
* Special handling for draggable multiple widgets and 'add more' button.
|
||||
*/
|
||||
|
|
@ -93,7 +93,7 @@ function forum_install() {
|
|||
* Implements hook_module_preinstall().
|
||||
*/
|
||||
function forum_module_preinstall($module) {
|
||||
$list_boolean = \Drupal::service('plugin.manager.entity.field.field_type')->getDefinition('list_boolean');
|
||||
$list_boolean = \Drupal::service('plugin.manager.field.field_type')->getDefinition('list_boolean');
|
||||
if (empty($list_boolean) && $module == 'forum') {
|
||||
// Make sure that the list_boolean field type is available before our
|
||||
// default config is installed.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Contains \Drupal\image\Plugin\field\formatter\ImageFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\image\Plugin\field\formatter;
|
||||
namespace Drupal\image\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
* Contains \Drupal\image\Plugin\field\formatter\ImageFormatterBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\image\Plugin\field\formatter;
|
||||
namespace Drupal\image\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\FieldInstanceInterface;
|
||||
use Drupal\file\Plugin\field\formatter\FileFormatterBase;
|
||||
use Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase;
|
||||
|
||||
/**
|
||||
* Base class for image file formatters.
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\image\Plugin\field\widget\ImageWidget.
|
||||
* Contains \Drupal\image\Plugin\Field\FieldWidget\ImageWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\image\Plugin\field\widget;
|
||||
namespace Drupal\image\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\file\Plugin\field\widget\FileWidget;
|
||||
use Drupal\file\Plugin\Field\FieldWidget\FileWidget;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +71,7 @@ class ImageWidget extends FileWidget {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\file\Plugin\field\widget\FileWidget::formMultipleElements().
|
||||
* Overrides \Drupal\file\Plugin\Field\FieldWidget\FileWidget::formMultipleElements().
|
||||
*
|
||||
* Special handling for draggable multiple widgets and 'add more' button.
|
||||
*/
|
||||
|
|
@ -5,12 +5,12 @@
|
|||
* Contains \Drupal\link\Plugin\field\formatter\LinkFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\link\Plugin\field\formatter;
|
||||
namespace Drupal\link\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Component\Utility\Url;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\Core\Entity\Field\FieldItemInterface;
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'link' formatter.
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
* http://drupal.org/node/1829202
|
||||
*/
|
||||
|
||||
namespace Drupal\link\Plugin\field\formatter;
|
||||
namespace Drupal\link\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\link\Plugin\field\widget\LinkWidget.
|
||||
* Contains \Drupal\link\Plugin\Field\FieldWidget\LinkWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\link\Plugin\field\widget;
|
||||
namespace Drupal\link\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 'link' widget.
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\number\Plugin\field\formatter\DefaultNumberFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\number\Plugin\field\formatter;
|
||||
namespace Drupal\number\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,9 +5,7 @@
|
|||
* Definition of Drupal\number\Plugin\field\formatter\NumberDecimalFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\number\Plugin\field\formatter;
|
||||
|
||||
use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter;
|
||||
namespace Drupal\number\Plugin\Field\FieldFormatter;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'number_decimal' formatter.
|
||||
|
|
@ -34,7 +32,7 @@ use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter;
|
|||
class NumberDecimalFormatter extends DefaultNumberFormatter {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\number\Plugin\field\formatter\DefaultNumberFormatter::settingsForm().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function settingsForm(array $form, array &$form_state) {
|
||||
$elements = parent::settingsForm($form, $form_state);
|
||||
|
|
@ -59,7 +57,7 @@ class NumberDecimalFormatter extends DefaultNumberFormatter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\number\Plugin\field\formatter\DefaultNumberFormatter::numberFormat().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function numberFormat($number) {
|
||||
return number_format($number, $this->getSetting('scale'), $this->getSetting('decimal_separator'), $this->getSetting('thousand_separator'));
|
||||
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\number\Plugin\field\formatter\NumberIntegerFormatter.
|
||||
* Contains \Drupal\number\Plugin\field\formatter\NumberIntegerFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\number\Plugin\field\formatter;
|
||||
|
||||
use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter;
|
||||
namespace Drupal\number\Plugin\Field\FieldFormatter;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'number_integer' formatter.
|
||||
|
|
@ -31,7 +29,7 @@ use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter;
|
|||
class NumberIntegerFormatter extends DefaultNumberFormatter {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\number\Plugin\field\formatter\DefaultNumberFormatter::numberFormat().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function numberFormat($number) {
|
||||
return number_format($number, 0, '', $this->getSetting('thousand_separator'));
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\number\Plugin\field\formatter\NumberUnformattedFormatter.
|
||||
* Contains \Drupal\number\Plugin\field\formatter\NumberUnformattedFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\number\Plugin\field\formatter;
|
||||
namespace Drupal\number\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -26,7 +26,7 @@ use Drupal\Core\Entity\Field\FieldItemListInterface;
|
|||
class NumberUnformattedFormatter extends FormatterBase {
|
||||
|
||||
/**
|
||||
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\number\Plugin\field\widget\NumberWidget.
|
||||
* Contains \Drupal\number\Plugin\Field\FieldWidget\NumberWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\number\Plugin\field\widget;
|
||||
namespace Drupal\number\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\options\Plugin\field\formatter\OptionsDefaultFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\formatter;
|
||||
namespace Drupal\options\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\options\Plugin\field\formatter\OptionsKeyFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\formatter;
|
||||
namespace Drupal\options\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\options\Plugin\field\widget\ButtonsWidget.
|
||||
* Contains \Drupal\options\Plugin\Field\FieldWidget\ButtonsWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\widget;
|
||||
namespace Drupal\options\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'options_buttons' widget.
|
||||
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\options\Plugin\field\widget\OnOffWidget.
|
||||
* Contains \Drupal\options\Plugin\Field\FieldWidget\OnOffWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\widget;
|
||||
namespace Drupal\options\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'options_onoff' widget.
|
||||
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\options\Plugin\field\widget\OptionsWidgetBase.
|
||||
* Contains \Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\widget;
|
||||
namespace Drupal\options\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldDefinitionInterface;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\Core\Entity\Field\FieldItemInterface;
|
||||
use Drupal\field\Plugin\Type\Widget\WidgetBase;
|
||||
use Drupal\Core\Field\WidgetBase;
|
||||
|
||||
/**
|
||||
* Base class for the 'options_*' widgets.
|
||||
|
|
@ -85,7 +85,7 @@ abstract class OptionsWidgetBase extends WidgetBase {
|
|||
}
|
||||
|
||||
// Massage submitted form values.
|
||||
// Drupal\field\Plugin\Type\Widget\WidgetBase::submit() expects values as
|
||||
// Drupal\Core\Field\WidgetBase::submit() expects values as
|
||||
// an array of values keyed by delta first, then by column, while our
|
||||
// widgets return the opposite.
|
||||
|
||||
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\options\Plugin\field\widget\SelectWidget.
|
||||
* Contains \Drupal\options\Plugin\Field\FieldWidget\SelectWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Plugin\field\widget;
|
||||
namespace Drupal\options\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\options\Plugin\Field\FieldWidget\OptionsWidgetBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'options_select' widget.
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
* Contains \Drupal\picture\Plugin\field\formatter\PictureFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\picture\Plugin\field\formatter;
|
||||
namespace Drupal\picture\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\image\Plugin\field\formatter\ImageFormatterBase;
|
||||
use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin for picture formatter.
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
* Contains \Drupal\taxonomy\Plugin\field\formatter\EntityReferenceTaxonomyTermRssFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\formatter;
|
||||
namespace Drupal\taxonomy\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
|
||||
use Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'entity reference taxonomy term RSS' formatter.
|
||||
|
|
@ -27,7 +27,7 @@ use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase;
|
|||
class EntityReferenceTaxonomyTermRssFormatter extends EntityReferenceFormatterBase {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase::viewElements().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = array();
|
||||
|
|
@ -5,10 +5,9 @@
|
|||
* Contains \Drupal\taxonomy\Plugin\field\formatter\LinkFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\formatter;
|
||||
namespace Drupal\taxonomy\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\taxonomy\Plugin\field\formatter\TaxonomyFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'taxonomy_term_reference_link' formatter.
|
||||
|
|
@ -5,10 +5,9 @@
|
|||
* Contains \Drupal\taxonomy\Plugin\field\formatter\PlainFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\formatter;
|
||||
namespace Drupal\taxonomy\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\taxonomy\Plugin\field\formatter\TaxonomyFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'taxonomy_term_reference_plain' formatter.
|
||||
|
|
@ -5,10 +5,9 @@
|
|||
* Contains \Drupal\taxonomy\Plugin\field\formatter\RSSCategoryFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\formatter;
|
||||
namespace Drupal\taxonomy\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
use Drupal\taxonomy\Plugin\field\formatter\TaxonomyFormatterBase;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the 'taxonomy_term_reference_rss_category' formatter.
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\taxonomy\Plugin\field\formatter\TaxonomyFormatterBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\formatter;
|
||||
namespace Drupal\taxonomy\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
|
||||
/**
|
||||
* Base class for the taxonomy_term formatters.
|
||||
|
|
@ -15,7 +15,7 @@ use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
|||
abstract class TaxonomyFormatterBase extends FormatterBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::prepareView().
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* This preloads all taxonomy terms for multiple loaded objects at once and
|
||||
* unsets values for invalid terms that do not exist.
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\taxonomy\Plugin\field\widget\TaxonomyAutocompleteWidget.
|
||||
* Contains \Drupal\taxonomy\Plugin\Field\FieldWidget\TaxonomyAutocompleteWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Plugin\field\widget;
|
||||
namespace Drupal\taxonomy\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 'taxonomy_autocomplete' widget.
|
||||
|
|
@ -1031,7 +1031,7 @@ function taxonomy_term_title(Term $term) {
|
|||
*/
|
||||
function taxonomy_autocomplete_validate($element, &$form_state) {
|
||||
// Split the values into an array.
|
||||
// @see \Drupal\taxonomy\Plugin\field\widget\TaxonomyAutocompleteWidget:massageFormValues()
|
||||
// @see \Drupal\taxonomy\Plugin\Field\FieldWidget\TaxonomyAutocompleteWidget:massageFormValues()
|
||||
$typed_terms = array();
|
||||
if ($tags = $element['#value']) {
|
||||
$typed_terms = drupal_explode_tags($tags);
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Contains \Drupal\telephone\Plugin\field\formatter\TelephoneLinkFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\telephone\Plugin\field\formatter;
|
||||
namespace Drupal\telephone\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\field\Plugin\Type\Formatter\FormatterBase;
|
||||
use Drupal\Core\Field\FormatterBase;
|
||||
use Drupal\Core\Entity\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue