Skip to content
Snippets Groups Projects
Select Git revision
  • b907c2f3aeb7def62a6d7e03c31ec484c14c09ce
  • 11.x default protected
  • 11.2.x protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

BooleanItem.php

  • webchick's avatar
    Issue #2191709 by andypost, Berdir: Remove the configurable flag on field types.
    Angie Byron authored
    b907c2f3
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    BooleanItem.php 1.07 KiB
    <?php
    
    /**
     * @file
     * Contains \Drupal\Core\Entity\Plugin\Field\FieldType\BooleanItem.
     */
    
    namespace Drupal\Core\Field\Plugin\Field\FieldType;
    
    use Drupal\Core\Field\FieldDefinitionInterface;
    use Drupal\Core\Field\FieldItemBase;
    use Drupal\Core\TypedData\DataDefinition;
    
    /**
     * Defines the 'boolean' entity field type.
     *
     * @FieldType(
     *   id = "boolean",
     *   label = @Translation("Boolean"),
     *   description = @Translation("An entity field containing a boolean value."),
     *   no_ui = TRUE
     * )
     */
    class BooleanItem extends FieldItemBase {
    
      /**
       * {@inheritdoc}
       */
      public static function propertyDefinitions(FieldDefinitionInterface $field_definition) {
        $properties['value'] = DataDefinition::create('boolean')
          ->setLabel(t('Boolean value'));
    
        return $properties;
      }
    
      /**
       * {@inheritdoc}
       */
      public static function schema(FieldDefinitionInterface $field_definition) {
        return array(
          'columns' => array(
            'value' => array(
              'type' => 'int',
              'size' => 'tiny',
              'not null' => TRUE,
            ),
          ),
        );
      }
    
    }