String.php

Definition of Drupal\Core\TypedData\Type\String.

Namespace

Drupal\Core\TypedData\Type

File

drupal/core/lib/Drupal/Core/TypedData/Type/String.php
View source
<?php

/**
 * @file
 * Definition of Drupal\Core\TypedData\Type\String.
 */
namespace Drupal\Core\TypedData\Type;

use Drupal\Core\TypedData\TypedDataInterface;

/**
 * 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.
 */
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.
  }

}

Classes

Namesort descending Description
String The string data type.