Issue #2119905 by damiankloip, tim.plunkett, Berdir: Provide @ConfigEntityType and @ContentEntityType to have better defaults.
parent
4022a54878
commit
b0da3ae64e
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Config\Entity\ConfigEntityType.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Config\Entity;
|
||||
|
||||
use Drupal\Core\Entity\EntityType;
|
||||
|
||||
/**
|
||||
* Provides an implementation of a config entity type and its metadata.
|
||||
*/
|
||||
class ConfigEntityType extends EntityType {
|
||||
|
||||
/**
|
||||
* Returns the config prefix used by the configuration entity type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $config_prefix;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerClasses() {
|
||||
return parent::getControllerClasses() + array(
|
||||
'storage' => 'Drupal\Core\Config\Entity\ConfigStorageController',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigPrefix() {
|
||||
return isset($this->config_prefix) ? $this->config_prefix : FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBaseTable() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getRevisionDataTable() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getRevisionTable() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDataTable() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Entity\Annotation\ConfigEntityType.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Entity\Annotation;
|
||||
|
||||
/**
|
||||
* Defines a config entity type annotation object.
|
||||
*
|
||||
* @Annotation
|
||||
*/
|
||||
class ConfigEntityType extends EntityType {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $entity_type_class = 'Drupal\Core\Config\Entity\ConfigEntityType';
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Entity\Annotation\ContentEntityType.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Entity\Annotation;
|
||||
|
||||
/**
|
||||
* Defines a content entity type annotation object.
|
||||
*
|
||||
* @Annotation
|
||||
*/
|
||||
class ContentEntityType extends EntityType {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $entity_type_class = 'Drupal\Core\Entity\ContentEntityType';
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Entity\ContentEntityType.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Defines a config entity type annotation object.
|
||||
*/
|
||||
class ContentEntityType extends EntityType {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerClasses() {
|
||||
return parent::getControllerClasses() + array(
|
||||
'storage' => 'Drupal\Core\Entity\FieldableDatabaseStorageController',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigPrefix() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
|
@ -163,13 +163,6 @@ class EntityType implements EntityTypeInterface {
|
|||
*/
|
||||
protected $translatable = FALSE;
|
||||
|
||||
/**
|
||||
* Returns the config prefix used by the configuration entity type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $config_prefix;
|
||||
|
||||
/**
|
||||
* The human-readable name of the type.
|
||||
*
|
||||
|
@ -541,7 +534,7 @@ class EntityType implements EntityTypeInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigPrefix() {
|
||||
return isset($this->config_prefix) ? $this->config_prefix : FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@ use Drupal\aggregator\FeedInterface;
|
|||
/**
|
||||
* Defines the aggregator feed entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "aggregator_feed",
|
||||
* label = @Translation("Aggregator feed"),
|
||||
* controllers = {
|
||||
|
|
|
@ -15,7 +15,7 @@ use Drupal\Core\Field\FieldDefinition;
|
|||
/**
|
||||
* Defines the aggregator item entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "aggregator_item",
|
||||
* label = @Translation("Aggregator feed item"),
|
||||
* controllers = {
|
||||
|
|
|
@ -15,12 +15,11 @@ use Drupal\custom_block\CustomBlockInterface;
|
|||
/**
|
||||
* Defines the custom block entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "custom_block",
|
||||
* label = @Translation("Custom Block"),
|
||||
* bundle_label = @Translation("Custom Block type"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\custom_block\CustomBlockAccessController",
|
||||
* "list" = "Drupal\custom_block\CustomBlockListController",
|
||||
* "view_builder" = "Drupal\custom_block\CustomBlockViewBuilder",
|
||||
|
|
|
@ -14,11 +14,10 @@ use Drupal\custom_block\CustomBlockTypeInterface;
|
|||
/**
|
||||
* Defines the custom block type entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "custom_block_type",
|
||||
* label = @Translation("Custom block type"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\custom_block\CustomBlockTypeFormController",
|
||||
* "add" = "Drupal\custom_block\CustomBlockTypeFormController",
|
||||
|
|
|
@ -15,11 +15,10 @@ use Drupal\Core\Entity\EntityStorageControllerInterface;
|
|||
/**
|
||||
* Defines a Block configuration entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "block",
|
||||
* label = @Translation("Block"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "access" = "Drupal\block\BlockAccessController",
|
||||
* "view_builder" = "Drupal\block\BlockViewBuilder",
|
||||
* "list" = "Drupal\block\BlockListController",
|
||||
|
|
|
@ -18,12 +18,9 @@ use Drupal\breakpoint\InvalidBreakpointMediaQueryException;
|
|||
/**
|
||||
* Defines the Breakpoint entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "breakpoint",
|
||||
* label = @Translation("Breakpoint"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "breakpoint.breakpoint",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
|
|
|
@ -15,12 +15,9 @@ use Drupal\breakpoint\InvalidBreakpointSourceTypeException;
|
|||
/**
|
||||
* Defines the BreakpointGroup entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "breakpoint_group",
|
||||
* label = @Translation("Breakpoint group"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "breakpoint.breakpoint_group",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
|
|
|
@ -19,7 +19,7 @@ use Drupal\user\UserInterface;
|
|||
/**
|
||||
* Defines the comment entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "comment",
|
||||
* label = @Translation("Comment"),
|
||||
* bundle_label = @Translation("Content type"),
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Drupal\config_test\Entity;
|
|||
/**
|
||||
* Defines the ConfigQueryTest configuration entity used by the query test.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "config_query_test",
|
||||
* label = @Translation("Test configuration for query"),
|
||||
* controllers = {
|
||||
|
|
|
@ -13,7 +13,7 @@ use Drupal\config_test\ConfigTestInterface;
|
|||
/**
|
||||
* Defines the ConfigTest configuration entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "config_test",
|
||||
* label = @Translation("Test configuration"),
|
||||
* controllers = {
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\contact\CategoryInterface;
|
|||
/**
|
||||
* Defines the contact category entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "contact_category",
|
||||
* label = @Translation("Contact category"),
|
||||
* controllers = {
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\Core\Field\FieldDefinition;
|
|||
/**
|
||||
* Defines the contact message entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "contact_message",
|
||||
* label = @Translation("Contact message"),
|
||||
* controllers = {
|
||||
|
|
|
@ -13,12 +13,9 @@ use Drupal\editor\EditorInterface;
|
|||
/**
|
||||
* Defines the configured text editor entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "editor",
|
||||
* label = @Translation("Editor"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "editor.editor",
|
||||
* entity_keys = {
|
||||
* "id" = "format",
|
||||
|
|
|
@ -14,12 +14,9 @@ use Drupal\entity\EntityDisplayBase;
|
|||
* Configuration entity that contains widget options for all components of a
|
||||
* entity form in a given form mode.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "entity_form_display",
|
||||
* label = @Translation("Entity form display"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "entity.form_display",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
|
|
|
@ -27,17 +27,17 @@ use Drupal\entity\EntityFormModeInterface;
|
|||
* @see entity_get_form_modes()
|
||||
* @see hook_entity_form_mode_info_alter()
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "form_mode",
|
||||
* label = @Translation("Form mode"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\entity\EntityDisplayModeStorageController",
|
||||
* "list" = "Drupal\entity\EntityFormModeListController",
|
||||
* "form" = {
|
||||
* "add" = "Drupal\entity\Form\EntityFormModeAddForm",
|
||||
* "edit" = "Drupal\entity\Form\EntityDisplayModeEditForm",
|
||||
* "delete" = "Drupal\entity\Form\EntityDisplayModeDeleteForm"
|
||||
* },
|
||||
* "storage" = "Drupal\entity\EntityDisplayModeStorageController"
|
||||
* }
|
||||
* },
|
||||
* admin_permission = "administer display modes",
|
||||
* config_prefix = "entity.form_mode",
|
||||
|
|
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityDisplayBase;
|
|||
* Configuration entity that contains display options for all components of a
|
||||
* rendered entity in a given view mode.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "entity_view_display",
|
||||
* label = @Translation("Entity view display"),
|
||||
* controllers = {
|
||||
|
|
|
@ -28,7 +28,7 @@ use Drupal\entity\EntityViewModeInterface;
|
|||
* @see entity_get_view_modes()
|
||||
* @see hook_entity_view_mode_info_alter()
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "view_mode",
|
||||
* label = @Translation("View mode"),
|
||||
* controllers = {
|
||||
|
@ -37,8 +37,7 @@ use Drupal\entity\EntityViewModeInterface;
|
|||
* "add" = "Drupal\entity\Form\EntityDisplayModeAddForm",
|
||||
* "edit" = "Drupal\entity\Form\EntityDisplayModeEditForm",
|
||||
* "delete" = "Drupal\entity\Form\EntityDisplayModeDeleteForm"
|
||||
* },
|
||||
* "storage" = "Drupal\entity\EntityDisplayModeStorageController"
|
||||
* }
|
||||
* },
|
||||
* admin_permission = "administer display modes",
|
||||
* config_prefix = "entity.view_mode",
|
||||
|
|
|
@ -21,7 +21,7 @@ use Drupal\field\FieldInterface;
|
|||
* @todo use 'field' as the id once hook_field_load() and friends
|
||||
* are removed.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "field_entity",
|
||||
* label = @Translation("Field"),
|
||||
* controllers = {
|
||||
|
|
|
@ -17,7 +17,7 @@ use Drupal\field\FieldInstanceInterface;
|
|||
/**
|
||||
* Defines the Field instance entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "field_instance",
|
||||
* label = @Translation("Field instance"),
|
||||
* controllers = {
|
||||
|
|
|
@ -17,7 +17,7 @@ use Drupal\user\UserInterface;
|
|||
/**
|
||||
* Defines the file entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "file",
|
||||
* label = @Translation("File"),
|
||||
* controllers = {
|
||||
|
|
|
@ -17,7 +17,7 @@ use Drupal\filter\Plugin\FilterInterface;
|
|||
/**
|
||||
* Represents a text format.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "filter_format",
|
||||
* label = @Translation("Text format"),
|
||||
* controllers = {
|
||||
|
@ -28,7 +28,6 @@ use Drupal\filter\Plugin\FilterInterface;
|
|||
* },
|
||||
* "list" = "Drupal\filter\FilterFormatListController",
|
||||
* "access" = "Drupal\filter\FilterFormatAccessController",
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "filter.format",
|
||||
* admin_permission = "administer filters",
|
||||
|
|
|
@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
|||
/**
|
||||
* Defines an image style configuration entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "image_style",
|
||||
* label = @Translation("Image style"),
|
||||
* controllers = {
|
||||
|
@ -29,7 +29,6 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
|||
* "delete" = "Drupal\image\Form\ImageStyleDeleteForm",
|
||||
* "flush" = "Drupal\image\Form\ImageStyleFlushForm"
|
||||
* },
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "list" = "Drupal\image\ImageStyleListController",
|
||||
* },
|
||||
* admin_permission = "administer image styles",
|
||||
|
|
|
@ -15,11 +15,10 @@ use Drupal\language\LanguageInterface;
|
|||
/**
|
||||
* Defines the Language entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "language_entity",
|
||||
* label = @Translation("Language"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "list" = "Drupal\language\LanguageListController",
|
||||
* "access" = "Drupal\language\LanguageAccessController",
|
||||
* "form" = {
|
||||
|
|
|
@ -17,14 +17,12 @@ use Drupal\migrate\Plugin\MigrateIdMapInterface;
|
|||
* The migration entity stores the information about a single migration, like
|
||||
* the source, process and destination plugins.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "migration",
|
||||
* label = @Translation("Migration"),
|
||||
* module = "migrate",
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "list" = "Drupal\Core\Config\Entity\DraggableListController",
|
||||
* "access" = "Drupal\Core\Entity\EntityAccessController",
|
||||
* "form" = {
|
||||
* "add" = "Drupal\Core\Entity\EntityFormController",
|
||||
* "edit" = "Drupal\Core\Entity\EntityFormController",
|
||||
|
|
|
@ -18,12 +18,11 @@ use Drupal\user\UserInterface;
|
|||
/**
|
||||
* Defines the node entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "node",
|
||||
* label = @Translation("Content"),
|
||||
* bundle_label = @Translation("Content type"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "view_builder" = "Drupal\node\NodeViewBuilder",
|
||||
* "access" = "Drupal\node\NodeAccessController",
|
||||
* "form" = {
|
||||
|
|
|
@ -16,11 +16,10 @@ use Drupal\node\NodeTypeInterface;
|
|||
/**
|
||||
* Defines the Node type configuration entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "node_type",
|
||||
* label = @Translation("Content type"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "access" = "Drupal\node\NodeTypeAccessController",
|
||||
* "form" = {
|
||||
* "add" = "Drupal\node\NodeTypeFormController",
|
||||
|
|
|
@ -13,11 +13,10 @@ use Drupal\picture\PictureMappingInterface;
|
|||
/**
|
||||
* Defines the Picture entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "picture_mapping",
|
||||
* label = @Translation("Picture mapping"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "list" = "Drupal\picture\PictureMappingListController",
|
||||
* "form" = {
|
||||
* "edit" = "Drupal\picture\PictureMappingFormController",
|
||||
|
|
|
@ -14,12 +14,9 @@ use Drupal\rdf\RdfMappingInterface;
|
|||
/**
|
||||
* Config entity for working with RDF mappings.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "rdf_mapping",
|
||||
* label = @Translation("RDF mapping"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
|
||||
* },
|
||||
* config_prefix = "rdf.mapping",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
|
|
|
@ -17,7 +17,7 @@ use Drupal\search\SearchPageInterface;
|
|||
/**
|
||||
* Defines a configured search page.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "search_page",
|
||||
* label = @Translation("Search page"),
|
||||
* controllers = {
|
||||
|
|
|
@ -17,12 +17,11 @@ use Drupal\shortcut\ShortcutInterface;
|
|||
/**
|
||||
* Defines the shortcut entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "shortcut",
|
||||
* label = @Translation("Shortcut link"),
|
||||
* module = "shortcut",
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\shortcut\ShortcutAccessController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\shortcut\ShortcutFormController",
|
||||
|
|
|
@ -15,7 +15,7 @@ use Drupal\shortcut\ShortcutSetInterface;
|
|||
/**
|
||||
* Defines the Shortcut configuration entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "shortcut_set",
|
||||
* label = @Translation("Shortcut set"),
|
||||
* controllers = {
|
||||
|
|
|
@ -16,12 +16,9 @@ use Drupal\Component\Plugin\ConfigurablePluginInterface;
|
|||
/**
|
||||
* Defines the configured action entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "action",
|
||||
* label = @Translation("Action"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* },
|
||||
* admin_permission = "administer actions",
|
||||
* config_prefix = "system.action",
|
||||
* entity_keys = {
|
||||
|
|
|
@ -15,11 +15,10 @@ use Drupal\system\DateFormatInterface;
|
|||
/**
|
||||
* Defines the Date Format configuration entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "date_format",
|
||||
* label = @Translation("Date format"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "access" = "Drupal\system\DateFormatAccessController",
|
||||
* "list" = "Drupal\system\DateFormatListController",
|
||||
* "form" = {
|
||||
|
|
|
@ -15,11 +15,10 @@ use Drupal\system\MenuInterface;
|
|||
/**
|
||||
* Defines the Menu configuration entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "menu",
|
||||
* label = @Translation("Menu"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "access" = "Drupal\system\MenuAccessController"
|
||||
* },
|
||||
* config_prefix = "system.menu",
|
||||
|
|
|
@ -3234,7 +3234,7 @@ function hook_link_alter(&$variables) {
|
|||
* To annotate a class as a plugin, add code similar to the following to the
|
||||
* end of the documentation block immediately preceding the class declaration:
|
||||
* @code
|
||||
* * @EntityType(
|
||||
* * @ContentEntityType(
|
||||
* * id = "comment",
|
||||
* * label = @Translation("Comment"),
|
||||
* * ...
|
||||
|
|
|
@ -17,11 +17,10 @@ use Drupal\user\UserInterface;
|
|||
/**
|
||||
* Defines the test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test",
|
||||
* label = @Translation("Test entity"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "list" = "Drupal\entity_test\EntityTestListController",
|
||||
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
|
|
|
@ -12,11 +12,10 @@ use Drupal\Core\Field\FieldDefinition;
|
|||
/**
|
||||
* Defines a test entity class for base fields display.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_base_field_display",
|
||||
* label = @Translation("Test entity - base field display"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\entity_test\EntityTestFormController"
|
||||
|
|
|
@ -12,11 +12,10 @@ use Drupal\Core\Language\Language;
|
|||
/**
|
||||
* Defines the test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_cache",
|
||||
* label = @Translation("Test entity with field cache"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\entity_test\EntityTestFormController"
|
||||
|
|
|
@ -10,12 +10,9 @@ namespace Drupal\entity_test\Entity;
|
|||
/**
|
||||
* Defines a test entity class with no access controller.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_default_access",
|
||||
* label = @Translation("Test entity with default access"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController"
|
||||
* },
|
||||
* base_table = "entity_test",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
||||
|
|
|
@ -10,11 +10,10 @@ namespace Drupal\entity_test\Entity;
|
|||
/**
|
||||
* Test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_label",
|
||||
* label = @Translation("Entity Test label"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder"
|
||||
* },
|
||||
* base_table = "entity_test",
|
||||
|
|
|
@ -10,12 +10,9 @@ namespace Drupal\entity_test\Entity;
|
|||
/**
|
||||
* Test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_label_callback",
|
||||
* label = @Translation("Entity test label callback"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController"
|
||||
* },
|
||||
* field_cache = FALSE,
|
||||
* base_table = "entity_test",
|
||||
* revision_table = "entity_test_revision",
|
||||
|
|
|
@ -13,11 +13,10 @@ use Drupal\entity_test\Entity\EntityTest;
|
|||
/**
|
||||
* Defines the test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_mul",
|
||||
* label = @Translation("Test entity - data table"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
* "form" = {
|
||||
|
|
|
@ -13,11 +13,10 @@ use Drupal\entity_test\Entity\EntityTestRev;
|
|||
/**
|
||||
* Defines the test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_mulrev",
|
||||
* label = @Translation("Test entity - revisions and data table"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\entity_test\EntityTestFormController"
|
||||
|
|
|
@ -10,12 +10,9 @@ namespace Drupal\entity_test\Entity;
|
|||
/**
|
||||
* Test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_no_label",
|
||||
* label = @Translation("Entity Test without label"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController"
|
||||
* },
|
||||
* field_cache = FALSE,
|
||||
* base_table = "entity_test",
|
||||
* entity_keys = {
|
||||
|
|
|
@ -13,11 +13,10 @@ use Drupal\entity_test\Entity\EntityTest;
|
|||
/**
|
||||
* Defines the test entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "entity_test_rev",
|
||||
* label = @Translation("Test entity - revisions"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
|
||||
* "access" = "Drupal\entity_test\EntityTestAccessController",
|
||||
* "form" = {
|
||||
* "default" = "Drupal\entity_test\EntityTestFormController"
|
||||
|
|
|
@ -17,7 +17,7 @@ use Drupal\taxonomy\TermInterface;
|
|||
/**
|
||||
* Defines the taxonomy term entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "taxonomy_term",
|
||||
* label = @Translation("Taxonomy term"),
|
||||
* bundle_label = @Translation("Vocabulary"),
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\taxonomy\VocabularyInterface;
|
|||
/**
|
||||
* Defines the taxonomy vocabulary entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "taxonomy_vocabulary",
|
||||
* label = @Translation("Taxonomy vocabulary"),
|
||||
* controllers = {
|
||||
|
|
|
@ -14,11 +14,10 @@ use Drupal\tour\TourInterface;
|
|||
/**
|
||||
* Defines the configured tour entity.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "tour",
|
||||
* label = @Translation("Tour"),
|
||||
* controllers = {
|
||||
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
|
||||
* "view_builder" = "Drupal\tour\TourViewBuilder"
|
||||
* },
|
||||
* config_prefix = "tour.tour",
|
||||
|
|
|
@ -15,7 +15,7 @@ use Drupal\user\RoleInterface;
|
|||
/**
|
||||
* Defines the user role entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "user_role",
|
||||
* label = @Translation("Role"),
|
||||
* controllers = {
|
||||
|
|
|
@ -16,7 +16,7 @@ use Drupal\user\UserInterface;
|
|||
/**
|
||||
* Defines the user entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ContentEntityType(
|
||||
* id = "user",
|
||||
* label = @Translation("User"),
|
||||
* controllers = {
|
||||
|
|
|
@ -18,7 +18,7 @@ use Drupal\views\ViewExecutable;
|
|||
/**
|
||||
* Defines a View configuration entity class.
|
||||
*
|
||||
* @EntityType(
|
||||
* @ConfigEntityType(
|
||||
* id = "view",
|
||||
* label = @Translation("View"),
|
||||
* controllers = {
|
||||
|
|
Loading…
Reference in New Issue