FieldType.php 2.69 KB
Newer Older
1 2 3 4 5 6 7
<?php

/**
 * @file
 * Contains \Drupal\Core\Entity\Annotation\FieldType.
 */

8
namespace Drupal\Core\Field\Annotation;
9

10
use Drupal\Core\TypedData\Annotation\DataType;
11 12 13 14 15 16 17 18 19

/**
 * Defines a FieldType annotation object.
 *
 * Additional annotation keys for field types can be defined in
 * hook_field_info_alter().
 *
 * @Annotation
 */
20
class FieldType extends DataType {
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * The name of the module providing the field type plugin.
   *
   * @var string
   */
  public $module;

  /**
   * The human-readable name of the field type.
   *
   * @ingroup plugin_translatable
   *
   * @var \Drupal\Core\Annotation\Translation
   */
  public $label;

  /**
   * A short human readable description for the field type.
   *
   * @ingroup plugin_translatable
   *
   * @var \Drupal\Core\Annotation\Translation
   */
  public $description;

  /**
   * An array of field-level settings available for the field type.
   *
   * Keys are the names of the settings, and values are the default values for
   * those settings.
   *
   * @var array
   */
  public $settings;

  /**
   * An array of instance-level settings available for the field type.
   *
   * Keys are the names of the settings, and values are the default values for
   * those settings.
   *
   * Instance-level settings can have different values on each field instance,
   * and thus allow greater flexibility than field-level settings. It is
   * recommended to put settings at the instance level whenever possible.
   * Notable exceptions: settings acting on the storage schema, or settings that
   * Views needs to use across field instances (for example, settings defining
   * the list of allowed values for the field).
   *
   * @var array
   */
  public $instance_settings;

  /**
   * The plugin_id of the default widget for this field type.
   *
   * This widget must be available whenever the field type is available (i.e.
   * provided by the field type module, or by a module the field type module
   * depends on).
   *
   * @var string
   */
  public $default_widget;

  /**
   * The plugin_id of the default formatter for this field type.
   *
   * This formatter must be available whenever the field type is available (i.e.
   * provided by the field type module, or by a module the field type module
   * depends on).
   *
   * @var string
   */
  public $default_formatter;

  /**
   * A boolean stating that fields of this type are configurable.
   *
   * @var boolean
   */
  public $configurable = TRUE;

  /**
   * A boolean stating that fields of this type cannot be created through the UI.
   *
   * @var boolean
   */
  public $no_ui = FALSE;

117 118 119 120 121
  /**
   * {@inheritdoc}
   */
  public $list_class;

122
}