You are here

BricksTreeItem.php in Bricks​ 2.x

Same filename and directory in other branches
  1. 8 src/Plugin/Field/FieldType/BricksTreeItem.php

File

src/Plugin/Field/FieldType/BricksTreeItem.php
View source
<?php

namespace Drupal\bricks\Plugin\Field\FieldType;

use Drupal\bricks\BricksFieldItemInterface;
use Drupal\bricks\BricksFieldTypeTrait;
use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;

/**
 * {@inheritdoc}
 *
 * @FieldType(
 *   id = "bricks",
 *   label = @Translation("Bricks"),
 *   description = @Translation("An entity field containing a tree of entity reference bricks."),
 *   category = @Translation("Reference"),
 *   default_widget = "entity_reference_autocomplete",
 *   default_formatter = "bricks_nested",
 *   list_class = "\Drupal\Core\Field\EntityReferenceFieldItemList",
 * )
 */
class BricksTreeItem extends EntityReferenceItem implements BricksFieldItemInterface {
  use BricksFieldTypeTrait;

  /**
   * {@inheritdoc}
   */
  public static function getPreconfiguredOptions() {
    return [];
  }

}

Classes

Namesort descending Description
BricksTreeItem Plugin annotation @FieldType( id = "bricks", label = @Translation("Bricks"), description = @Translation("An entity field containing a tree of entity reference bricks."), category = @Translation("Reference"), default_widget =…