diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index bade4d5..79345a8 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -68,140 +68,6 @@ function field_behaviors_widget($op, $instance) { } /** -<<<<<<< HEAD -======= - * Returns a lightweight map of fields across bundles. - * - * The function only returns active, non deleted fields. - * - * @return - * An array keyed by field name. Each value is an array with two entries: - * - type: The field type. - * - bundles: The bundles in which the field appears, as an array with entity - * types as keys and the array of bundle names as values. - * Example: - * @code - * array( - * 'body' => array( - * 'bundles' => array( - * 'node' => array('page', 'article'), - * ), - * 'type' => 'text_with_summary', - * ), - * ); - * @endcode - * - * @deprecated as of Drupal 8.0. Use - * Field::fieldInfo()->getFieldMap(). - */ -function field_info_field_map() { - return Field::fieldInfo()->getFieldMap(); -} - -/** - * Returns information about configurable field types. - * - * @param $field_type - * (optional) A field type name. If omitted, all field types will be returned. - * - * @return - * Either a field type definition, or an array of all existing field types, - * keyed by field type name. - * - * @deprecated as of Drupal 8.0. Use - * Drupal::service('plugin.manager.entity.field.field_type')->getDefinition() - * or - * Drupal::service('plugin.manager.entity.field.field_type')->getDefinitions() - */ -function field_info_field_types($field_type = NULL) { - if ($field_type) { - return Drupal::service('plugin.manager.entity.field.field_type')->getDefinition($field_type); - } - else { - return array_filter(Drupal::service('plugin.manager.entity.field.field_type')->getDefinitions(), function ($definition) { - return $definition['configurable']; - }); - } -} - -/** - * Returns information about field widgets from AnnotatedClassDiscovery. - * - * @param string $widget_type - * (optional) A widget type name. If omitted, all widget types will be - * returned. - * - * @return array - * Either a single widget type description, as provided by class annotations, - * or an array of all existing widget types, keyed by widget type name. - * - * @deprecated as of Drupal 8.0. Use - * Drupal::service('plugin.manager.field.widget')->getDefinition() - * or - * Drupal::service('plugin.manager.field.widget')->getDefinitions() - */ -function field_info_widget_types($widget_type = NULL) { - if ($widget_type) { - return drupal_container()->get('plugin.manager.field.widget')->getDefinition($widget_type); - } - else { - return drupal_container()->get('plugin.manager.field.widget')->getDefinitions(); - } -} - -/** - * Returns information about field formatters from hook_field_formatter_info(). - * - * @param string $formatter_type - * (optional) A formatter type name. If omitted, all formatter types will be - * returned. - * - * @return array - * Either a single formatter type description, as provided by class - * annotations, or an array of all existing formatter types, keyed by - * formatter type name. - * - * @deprecated as of Drupal 8.0. Use - * Drupal::service('plugin.manager.field.formatter')->getDefinition() - * or - * Drupal::service('plugin.manager.field.formatter')->getDefinitions() - */ -function field_info_formatter_types($formatter_type = NULL) { - if ($formatter_type) { - return drupal_container()->get('plugin.manager.field.formatter')->getDefinition($formatter_type); - } - else { - return drupal_container()->get('plugin.manager.field.formatter')->getDefinitions(); - } -} - -/** - * Returns information about field storage from hook_field_storage_info(). - * - * @param $storage_type - * (optional) A storage type name. If omitted, all storage types will be - * returned. - * - * @return - * Either a storage type description, as provided by - * hook_field_storage_info(), or an array of all existing storage types, keyed - * by storage type name. - */ -function field_info_storage_types($storage_type = NULL) { - $info = _field_info_collate_types(); - $storage_types = $info['storage types']; - if ($storage_type) { - if (isset($storage_types[$storage_type])) { - return $storage_types[$storage_type]; - } - } - else { - return $storage_types; - } -} - -/** ->>>>>>> applied patch * Returns all field definitions. * * Use of this function should be avoided when possible, since it loads and