StringItem.php

Definition of Drupal\Core\Entity\Field\Type\StringItem.

Namespace

Drupal\Core\Entity\Field\Type

File

drupal/core/lib/Drupal/Core/Entity/Field/Type/StringItem.php
View source
<?php

/**
 * @file
 * Definition of Drupal\Core\Entity\Field\Type\StringItem.
 */
namespace Drupal\Core\Entity\Field\Type;

use Drupal\Core\Entity\Field\FieldItemBase;

/**
 * Defines the 'string_field' entity field item.
 */
class StringItem extends FieldItemBase {

  /**
   * Field definitions of the contained properties.
   *
   * @see self::getPropertyDefinitions()
   *
   * @var array
   */
  static $propertyDefinitions;

  /**
   * Implements ComplexDataInterface::getPropertyDefinitions().
   */
  public function getPropertyDefinitions() {
    if (!isset(self::$propertyDefinitions)) {
      self::$propertyDefinitions['value'] = array(
        'type' => 'string',
        'label' => t('Text value'),
      );
    }
    return self::$propertyDefinitions;
  }

}

Classes

Namesort descending Description
StringItem Defines the 'string_field' entity field item.