3 namespace Drupal\Core\TypedData\Plugin\DataType;
5 use Drupal\Core\TypedData\PrimitiveBase;
6 use Drupal\Core\TypedData\Type\BooleanInterface;
9 * The boolean data type.
11 * The plain value of a boolean is a regular PHP boolean. For setting the value
12 * any PHP variable that casts to a boolean may be passed.
16 * label = @Translation("Boolean")
19 class BooleanData extends PrimitiveBase implements BooleanInterface {
24 public function getCastedValue() {
25 return (bool) $this->value;