Enum.php
Same filename in this branch
Same filename and directory in other branches
Namespace
Drupal\Core\TypedData\Plugin\DataTypeFile
-
core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ Enum.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Core\TypedData\Plugin\DataType;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\TypedData\Attribute\DataType;
use Drupal\Core\TypedData\PrimitiveBase;
/**
* The "enum" data type.
*
* @ingroup typed_data
*/
class Enum extends PrimitiveBase {
/**
* {@inheritdoc}
*/
public function getConstraints() : array {
$constraints = parent::getConstraints();
$constraints[] = $this->getTypedDataManager()
->getValidationConstraintManager()
->create('Enum', []);
return $constraints;
}
/**
* {@inheritdoc}
*/
public function getCastedValue() {
return $this->getValue();
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| Enum | The "enum" data type. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.