FieldTypeCategory.php

Same filename in other branches
  1. 11.x core/lib/Drupal/Core/Field/FieldTypeCategory.php

Namespace

Drupal\Core\Field

File

core/lib/Drupal/Core/Field/FieldTypeCategory.php

View source
<?php

namespace Drupal\Core\Field;

use Drupal\Core\Plugin\PluginBase;

/**
 * Default object used for field_type_categories plugins.
 *
 * @see \Drupal\Core\Field\FieldTypeCategoryManager
 */
class FieldTypeCategory extends PluginBase implements FieldTypeCategoryInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getLabel() : string|\Stringable {
        return $this->pluginDefinition['label'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getDescription() : string|\Stringable {
        return $this->pluginDefinition['description'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getWeight() : int {
        return $this->pluginDefinition['weight'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getLibraries() : array {
        return $this->pluginDefinition['libraries'] ?? [];
    }

}

Classes

Title Deprecated Summary
FieldTypeCategory Default object used for field_type_categories plugins.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.