From 49a419dea204289d7d5229e1b653c0e152363fbc Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Wed, 9 Mar 2016 08:33:30 +0900 Subject: [PATCH] Issue #2471689 by klopez, shashikant_chauhan, harings_rob, snehi, jhodgdon: Entity API documentation should consistently refer to handlers rather than controllers --- core/includes/entity.inc | 13 ++++++------- core/lib/Drupal/Core/Entity/EntityHandlerBase.php | 2 ++ .../Drupal/Core/Entity/EntityHandlerInterface.php | 2 ++ core/lib/Drupal/Core/Entity/entity.api.php | 14 +++++++------- core/modules/aggregator/src/FeedForm.php | 2 +- core/modules/aggregator/src/FeedViewBuilder.php | 2 +- core/modules/aggregator/src/ItemViewBuilder.php | 2 +- .../modules/block_content/src/BlockContentForm.php | 2 +- .../block_content/src/BlockContentViewBuilder.php | 2 +- core/modules/comment/src/CommentForm.php | 2 +- core/modules/comment/src/CommentStorage.php | 2 +- core/modules/comment/src/CommentTypeForm.php | 2 +- core/modules/comment/src/CommentViewBuilder.php | 2 +- .../field_ui/src/EntityDisplayModeListBuilder.php | 6 +++--- .../field_ui/src/EntityFormModeListBuilder.php | 2 +- core/modules/language/src/LanguageListBuilder.php | 2 +- core/modules/node/src/NodeForm.php | 2 +- core/modules/node/src/NodeGrantDatabaseStorage.php | 2 +- core/modules/node/src/NodeStorage.php | 2 +- core/modules/node/src/NodeTypeForm.php | 2 +- core/modules/node/src/NodeViewBuilder.php | 2 +- .../node/src/Plugin/views/argument/Type.php | 2 +- core/modules/shortcut/src/ShortcutForm.php | 2 +- core/modules/shortcut/src/ShortcutSetForm.php | 2 +- core/modules/taxonomy/src/Form/OverviewTerms.php | 2 +- core/modules/taxonomy/src/TermForm.php | 2 +- core/modules/taxonomy/src/TermViewBuilder.php | 2 +- core/modules/taxonomy/src/VocabularyStorage.php | 2 +- core/modules/user/src/ProfileForm.php | 2 +- core/modules/user/src/RegisterForm.php | 2 +- core/modules/views/src/EntityViewsData.php | 4 ++-- 31 files changed, 47 insertions(+), 44 deletions(-) diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 3cfac3f66c..d48aa4eb27 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -145,16 +145,15 @@ function entity_revision_delete($entity_type, $revision_id) { * database access if loaded again during the same page request. * * The actual loading is done through a class that has to implement the - * Drupal\Core\Entity\EntityStorageInterface interface. By default, - * Drupal\Core\Entity\Sql\SqlContentEntityStorage is used for content entities + * \Drupal\Core\Entity\EntityStorageInterface interface. By default, + * \Drupal\Core\Entity\Sql\SqlContentEntityStorage is used for content entities * and Drupal\Core\Config\Entity\ConfigEntityStorage for config entities. Entity * types can specify that a different class should be used by setting the - * "controllers['storage']" key in the entity plugin annotation. These classes - * can either implement the Drupal\Core\Entity\EntityStorageInterface + * "handlers['storage']" key in the entity plugin annotation. These classes + * can either implement the \Drupal\Core\Entity\EntityStorageInterface * interface, or, most commonly, extend the - * Drupal\Core\Entity\Sql\SqlContentEntityStorage class. - * See Drupal\node\Entity\Node and Drupal\node\NodeStorage - * for an example. + * \Drupal\Core\Entity\Sql\SqlContentEntityStorage class. See + * \Drupal\node\Entity\Node and \Drupal\node\NodeStorage for an example. * * @param string $entity_type * The entity type to load, e.g. node or user. diff --git a/core/lib/Drupal/Core/Entity/EntityHandlerBase.php b/core/lib/Drupal/Core/Entity/EntityHandlerBase.php index c4ec4a3552..ef9eb34efc 100644 --- a/core/lib/Drupal/Core/Entity/EntityHandlerBase.php +++ b/core/lib/Drupal/Core/Entity/EntityHandlerBase.php @@ -18,6 +18,8 @@ * Implement the container injection pattern of * \Drupal\Core\Entity\EntityHandlerInterface::createInstance() to obtain the * module handler service for your class. + * + * @ingroup entity_api */ abstract class EntityHandlerBase { use StringTranslationTrait; diff --git a/core/lib/Drupal/Core/Entity/EntityHandlerInterface.php b/core/lib/Drupal/Core/Entity/EntityHandlerInterface.php index f6b862a4bd..f7811881d5 100644 --- a/core/lib/Drupal/Core/Entity/EntityHandlerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityHandlerInterface.php @@ -14,6 +14,8 @@ * * This interface can be implemented by entity handlers that require * dependency injection. + * + * @ingroup entity_api */ interface EntityHandlerInterface { diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php index 251a87c7bd..064ef01bec 100644 --- a/core/lib/Drupal/Core/Entity/entity.api.php +++ b/core/lib/Drupal/Core/Entity/entity.api.php @@ -277,8 +277,8 @@ * content entity type that uses bundles, the 'bundle_label' annotation gives * the human-readable name to use for a bundle of this entity type (for * example, "Content type" for the Node entity). - * - The annotation will refer to several controller classes, which you will - * also need to define: + * - The annotation will refer to several handler classes, which you will also + * need to define: * - list_builder: Define a class that extends * \Drupal\Core\Config\Entity\ConfigEntityListBuilder (for configuration * entities) or \Drupal\Core\Entity\EntityListBuilder (for content @@ -298,7 +298,7 @@ * annotation has value TRUE), define a class that extends * \Drupal\content_translation\ContentTranslationHandler, to translate * the content. Configuration translation is handled automatically by the - * Configuration Translation module, without the need of a controller class. + * Configuration Translation module, without the need of a handler class. * - access: If your configuration entity has complex permissions, you might * need an access control handling, implementing * \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most entities @@ -381,10 +381,10 @@ * an object to the controller for the route. * - defaults: For entity form routes, use _entity_form rather than the generic * _controller or _form. The value is composed of the entity type machine name - * and a form controller type from the entity annotation (see @ref define - * above more more on controllers and annotation). So, in this example, - * block.default refers to the 'default' form controller on the block entity - * type, whose annotation contains: + * and a form handler type from the entity annotation (see @ref define above + * more more on handlers and annotation). So, in this example, block.default + * refers to the 'default' form handler on the block entity type, whose + * annotation contains: * @code * handlers = { * "form" = { diff --git a/core/modules/aggregator/src/FeedForm.php b/core/modules/aggregator/src/FeedForm.php index 3f06ddb41b..7502f54e3c 100644 --- a/core/modules/aggregator/src/FeedForm.php +++ b/core/modules/aggregator/src/FeedForm.php @@ -12,7 +12,7 @@ use Drupal\Core\Url; /** - * Form controller for the aggregator feed edit forms. + * Form handler for the aggregator feed edit forms. */ class FeedForm extends ContentEntityForm { diff --git a/core/modules/aggregator/src/FeedViewBuilder.php b/core/modules/aggregator/src/FeedViewBuilder.php index 11b78ab4d3..e88090e248 100644 --- a/core/modules/aggregator/src/FeedViewBuilder.php +++ b/core/modules/aggregator/src/FeedViewBuilder.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Render controller for aggregator feed items. + * View builder handler for aggregator feeds. */ class FeedViewBuilder extends EntityViewBuilder { diff --git a/core/modules/aggregator/src/ItemViewBuilder.php b/core/modules/aggregator/src/ItemViewBuilder.php index 1f0c23a386..0e386e9ef8 100644 --- a/core/modules/aggregator/src/ItemViewBuilder.php +++ b/core/modules/aggregator/src/ItemViewBuilder.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityViewBuilder; /** - * Render controller for aggregator feed items. + * View builder handler for aggregator feed items. */ class ItemViewBuilder extends EntityViewBuilder { diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php index 088c4d7bf4..ffe2f992dd 100644 --- a/core/modules/block_content/src/BlockContentForm.php +++ b/core/modules/block_content/src/BlockContentForm.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Form controller for the custom block edit forms. + * Form handler for the custom block edit forms. */ class BlockContentForm extends ContentEntityForm { diff --git a/core/modules/block_content/src/BlockContentViewBuilder.php b/core/modules/block_content/src/BlockContentViewBuilder.php index 87b7aed173..44380c54e2 100644 --- a/core/modules/block_content/src/BlockContentViewBuilder.php +++ b/core/modules/block_content/src/BlockContentViewBuilder.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityViewBuilder; /** - * Render controller for custom blocks. + * View builder handler for custom blocks. */ class BlockContentViewBuilder extends EntityViewBuilder { diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index dd92f2b2e3..d5b7f0c7b1 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Base for controller for comment forms. + * Base handler for comment forms. */ class CommentForm extends ContentEntityForm { diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php index 099e5f41cd..5ed080fce0 100644 --- a/core/modules/comment/src/CommentStorage.php +++ b/core/modules/comment/src/CommentStorage.php @@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the controller class for comments. + * Defines the storage handler class for comments. * * This extends the Drupal\Core\Entity\Sql\SqlContentEntityStorage class, * adding required special handling for comment entities. diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php index 16a1c0436a..20c2820c77 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Base form controller for category edit forms. + * Base form handler for comment type edit forms. */ class CommentTypeForm extends EntityForm { diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php index 22914d310a..9b47b7c7b1 100644 --- a/core/modules/comment/src/CommentViewBuilder.php +++ b/core/modules/comment/src/CommentViewBuilder.php @@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Render controller for comments. + * View builder handler for comments. */ class CommentViewBuilder extends EntityViewBuilder { diff --git a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php index 159596319a..080cf1ee36 100644 --- a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php +++ b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php @@ -130,14 +130,14 @@ public function render() { } /** - * Filters entities based on their controllers. + * Filters entities based on their view builder handlers. * * @param $entity_type * The entity type of the entity that needs to be validated. * * @return bool - * TRUE if the entity has the correct controller, FALSE if the entity - * doesn't has the correct controller. + * TRUE if the entity has the correct view builder handler, FALSE if the + * entity doesn't have the correct view builder handler. */ protected function isValidEntity($entity_type) { return $this->entityTypes[$entity_type]->get('field_ui_base_route') && $this->entityTypes[$entity_type]->hasViewBuilderClass(); diff --git a/core/modules/field_ui/src/EntityFormModeListBuilder.php b/core/modules/field_ui/src/EntityFormModeListBuilder.php index f6fc24b47f..741b23efbd 100644 --- a/core/modules/field_ui/src/EntityFormModeListBuilder.php +++ b/core/modules/field_ui/src/EntityFormModeListBuilder.php @@ -15,7 +15,7 @@ class EntityFormModeListBuilder extends EntityDisplayModeListBuilder { /** - * Filters entities based on their controllers. + * Filters entities based on their form mode handlers. * * @param $entity_type * The entity type of the entity that needs to be validated. diff --git a/core/modules/language/src/LanguageListBuilder.php b/core/modules/language/src/LanguageListBuilder.php index fe4e7a12fd..e6b279d366 100644 --- a/core/modules/language/src/LanguageListBuilder.php +++ b/core/modules/language/src/LanguageListBuilder.php @@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage - * The entity storage controller class. + * The entity storage handler class. * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager * The language manager. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index bb6c49d728..e273fc3397 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Form controller for the node edit forms. + * Form handler for the node edit forms. */ class NodeForm extends ContentEntityForm { diff --git a/core/modules/node/src/NodeGrantDatabaseStorage.php b/core/modules/node/src/NodeGrantDatabaseStorage.php index eb87a4dd02..58f8540432 100644 --- a/core/modules/node/src/NodeGrantDatabaseStorage.php +++ b/core/modules/node/src/NodeGrantDatabaseStorage.php @@ -16,7 +16,7 @@ use Drupal\Core\Session\AccountInterface; /** - * Defines a controller class that handles the node grants system. + * Defines a storage handler class that handles the node grants system. * * This is used to build node query access. * diff --git a/core/modules/node/src/NodeStorage.php b/core/modules/node/src/NodeStorage.php index 830fc3265d..da8e4a3b39 100644 --- a/core/modules/node/src/NodeStorage.php +++ b/core/modules/node/src/NodeStorage.php @@ -12,7 +12,7 @@ use Drupal\Core\Language\LanguageInterface; /** - * Defines the controller class for nodes. + * Defines the storage handler class for nodes. * * This extends the base storage class, adding required special handling for * node entities. diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php index e4f8cf570a..8c85e47b28 100644 --- a/core/modules/node/src/NodeTypeForm.php +++ b/core/modules/node/src/NodeTypeForm.php @@ -15,7 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Form controller for node type forms. + * Form handler for node type forms. */ class NodeTypeForm extends BundleEntityFormBase { diff --git a/core/modules/node/src/NodeViewBuilder.php b/core/modules/node/src/NodeViewBuilder.php index 1ee05f6afe..db3a7b489f 100644 --- a/core/modules/node/src/NodeViewBuilder.php +++ b/core/modules/node/src/NodeViewBuilder.php @@ -13,7 +13,7 @@ use Drupal\node\Entity\Node; /** - * Render controller for nodes. + * View builder handler for nodes. */ class NodeViewBuilder extends EntityViewBuilder { diff --git a/core/modules/node/src/Plugin/views/argument/Type.php b/core/modules/node/src/Plugin/views/argument/Type.php index 62ab17dbbf..3ef433905f 100644 --- a/core/modules/node/src/Plugin/views/argument/Type.php +++ b/core/modules/node/src/Plugin/views/argument/Type.php @@ -19,7 +19,7 @@ class Type extends StringArgument { /** - * NodeType storage controller. + * NodeType storage handler. * * @var \Drupal\Core\Entity\EntityStorageInterface */ diff --git a/core/modules/shortcut/src/ShortcutForm.php b/core/modules/shortcut/src/ShortcutForm.php index c0f8714e39..f2f16e91a3 100644 --- a/core/modules/shortcut/src/ShortcutForm.php +++ b/core/modules/shortcut/src/ShortcutForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\FormStateInterface; /** - * Form controller for the shortcut entity forms. + * Form handler for the shortcut entity forms. */ class ShortcutForm extends ContentEntityForm { diff --git a/core/modules/shortcut/src/ShortcutSetForm.php b/core/modules/shortcut/src/ShortcutSetForm.php index fd21f7c776..7bb6ced92a 100644 --- a/core/modules/shortcut/src/ShortcutSetForm.php +++ b/core/modules/shortcut/src/ShortcutSetForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\FormStateInterface; /** - * Form controller for the shortcut set entity edit forms. + * Form handler for the shortcut set entity edit forms. */ class ShortcutSetForm extends BundleEntityFormBase { diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php index dffbe34e65..a44bc54d41 100644 --- a/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -27,7 +27,7 @@ class OverviewTerms extends FormBase { protected $moduleHandler; /** - * The term storage controller. + * The term storage handler. * * @var \Drupal\taxonomy\TermStorageInterface */ diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index 9da0993643..ba1dcb3295 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\FormStateInterface; /** - * Base for controller for taxonomy term edit forms. + * Base for handler for taxonomy term edit forms. */ class TermForm extends ContentEntityForm { diff --git a/core/modules/taxonomy/src/TermViewBuilder.php b/core/modules/taxonomy/src/TermViewBuilder.php index efd4374f1f..ee9593f54a 100644 --- a/core/modules/taxonomy/src/TermViewBuilder.php +++ b/core/modules/taxonomy/src/TermViewBuilder.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityViewBuilder; /** - * Render controller for taxonomy terms. + * View builder handler for taxonomy terms. */ class TermViewBuilder extends EntityViewBuilder { diff --git a/core/modules/taxonomy/src/VocabularyStorage.php b/core/modules/taxonomy/src/VocabularyStorage.php index b761bcc22c..5fb3c3f0e9 100644 --- a/core/modules/taxonomy/src/VocabularyStorage.php +++ b/core/modules/taxonomy/src/VocabularyStorage.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityStorage; /** - * Defines a controller class for taxonomy vocabularies. + * Defines a storage handler class for taxonomy vocabularies. */ class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorageInterface { diff --git a/core/modules/user/src/ProfileForm.php b/core/modules/user/src/ProfileForm.php index e1196931c5..c8cc6138b1 100644 --- a/core/modules/user/src/ProfileForm.php +++ b/core/modules/user/src/ProfileForm.php @@ -13,7 +13,7 @@ use Drupal\Core\Language\LanguageManagerInterface; /** - * Form controller for the profile forms. + * Form handler for the profile forms. */ class ProfileForm extends AccountForm { diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php index 377b67c490..91d472f62b 100644 --- a/core/modules/user/src/RegisterForm.php +++ b/core/modules/user/src/RegisterForm.php @@ -13,7 +13,7 @@ use Drupal\Core\Language\LanguageManagerInterface; /** - * Form controller for the user register forms. + * Form handler for the user register forms. */ class RegisterForm extends AccountForm { diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index 1ae570923b..3b57d53f2a 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -28,7 +28,7 @@ class EntityViewsData implements EntityHandlerInterface, EntityViewsDataInterfac use StringTranslationTrait; /** - * Entity type for this views controller instance. + * Entity type for this views data handler instance. * * @var \Drupal\Core\Entity\EntityTypeInterface */ @@ -68,7 +68,7 @@ class EntityViewsData implements EntityHandlerInterface, EntityViewsDataInterfac * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type to provide views integration for. * @param \Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage_controller - * The storage controller used for this entity type. + * The storage handler used for this entity type. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler -- GitLab