Backup of db before drupal security update
[yaffs-website] / web / core / lib / Drupal / Core / TypedData / Plugin / DataType / BooleanData.php
1 <?php
2
3 namespace Drupal\Core\TypedData\Plugin\DataType;
4
5 use Drupal\Core\TypedData\PrimitiveBase;
6 use Drupal\Core\TypedData\Type\BooleanInterface;
7
8 /**
9  * The boolean data type.
10  *
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.
13  *
14  * @DataType(
15  *   id = "boolean",
16  *   label = @Translation("Boolean")
17  * )
18  */
19 class BooleanData extends PrimitiveBase implements BooleanInterface {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getCastedValue() {
25     return (bool) $this->value;
26   }
27
28 }