Newer
Older
Dries Buytaert
committed
<?php
Alex Pott
committed
namespace Drupal\Core\TypedData\Plugin\DataType;
Dries Buytaert
committed
Alex Pott
committed
use Drupal\Core\TypedData\PrimitiveBase;
use Drupal\Core\TypedData\Type\StringInterface;
Dries Buytaert
committed
/**
* 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.
Alex Pott
committed
*
* @DataType(
* id = "string",
Alex Pott
committed
* label = @Translation("String")
Alex Pott
committed
* )
Dries Buytaert
committed
*/
class StringData extends PrimitiveBase implements StringInterface {
Dries Buytaert
committed
Dries Buytaert
committed
/**
* {@inheritdoc}
Dries Buytaert
committed
*/
public function getCastedValue() {
return $this->getString();
}