class String

Same name in this branch

The string data type.

The plain value of a string is a regular PHP string. For setting the value any PHP variable that casts to a string may be passed.

Hierarchy

Expanded class hierarchy of String

1 file declares its use of String
TextProcessed.php in drupal/core/modules/field/modules/text/lib/Drupal/text/TextProcessed.php
Definition of Drupal\text\TextProcessed.
1 string reference to 'String'
system_data_type_info in drupal/core/modules/system/system.module
Implements hook_data_type_info().

File

drupal/core/lib/Drupal/Core/TypedData/Type/String.php, line 18
Definition of Drupal\Core\TypedData\Type\String.

Namespace

Drupal\Core\TypedData\Type
View source
class String extends TypedData implements TypedDataInterface {

  /**
   * The data value.
   *
   * @var string
   */
  protected $value;

  /**
   * Implements TypedDataInterface::setValue().
   */
  public function setValue($value) {
    $this->value = isset($value) ? (string) $value : $value;
  }

  /**
   * Implements TypedDataInterface::validate().
   */
  public function validate() {

    // TODO: Implement validate() method.
  }

}

Members

Namesort descending Modifiers Type Description Overrides
String::$value protected property The data value.
String::setValue public function Implements TypedDataInterface::setValue(). Overrides TypedData::setValue 1
String::validate public function Implements TypedDataInterface::validate(). Overrides TypedDataInterface::validate
TypedData::$definition protected property The data definition.
TypedData::getDefinition public function Implements TypedDataInterface::getDefinition(). Overrides TypedDataInterface::getDefinition
TypedData::getString public function Implements TypedDataInterface::getString(). Overrides TypedDataInterface::getString 8
TypedData::getType public function Implements TypedDataInterface::getType(). Overrides TypedDataInterface::getType
TypedData::getValue public function Implements TypedDataInterface::getValue(). Overrides TypedDataInterface::getValue 7
TypedData::__construct public function Constructs a TypedData object given its definition. 3