StringData.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php
  2. 8.9.x core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php
  3. 11.x core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php

Namespace

Drupal\Core\TypedData\Plugin\DataType

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php

View source
<?php

namespace Drupal\Core\TypedData\Plugin\DataType;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\TypedData\Attribute\DataType;
use Drupal\Core\TypedData\PrimitiveBase;
use Drupal\Core\TypedData\Type\StringInterface;

/**
 * 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 StringData extends PrimitiveBase implements StringInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getCastedValue() {
        return $this->getString();
    }

}

Classes

Title Deprecated Summary
StringData The string data type.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.