Commit 49a419de authored by catch's avatar catch

Issue #2471689 by klopez, shashikant_chauhan, harings_rob, snehi, jhodgdon:...

Issue #2471689 by klopez, shashikant_chauhan, harings_rob, snehi, jhodgdon: Entity API documentation should consistently refer to handlers rather than controllers
parent 563ef195
......@@ -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.
......
......@@ -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;
......
......@@ -14,6 +14,8 @@
*
* This interface can be implemented by entity handlers that require
* dependency injection.
*
* @ingroup entity_api
*/
interface EntityHandlerInterface {
......
......@@ -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" = {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -12,7 +12,7 @@
use Drupal\Core\Entity\EntityViewBuilder;
/**
* Render controller for custom blocks.
* View builder handler for custom blocks.
*/
class BlockContentViewBuilder extends EntityViewBuilder {
......
......@@ -20,7 +20,7 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Base for controller for comment forms.
* Base handler for comment forms.
*/
class CommentForm extends ContentEntityForm {
......
......@@ -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.
......
......@@ -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 {
......
......@@ -18,7 +18,7 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Render controller for comments.
* View builder handler for comments.
*/
class CommentViewBuilder extends EntityViewBuilder {
......
......@@ -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();
......
......@@ -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.
......
......@@ -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
......
......@@ -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 {
......
......@@ -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.
*
......
......@@ -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.
......
......@@ -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 {
......
......@@ -13,7 +13,7 @@
use Drupal\node\Entity\Node;
/**
* Render controller for nodes.
* View builder handler for nodes.
*/
class NodeViewBuilder extends EntityViewBuilder {
......
......@@ -19,7 +19,7 @@
class Type extends StringArgument {
/**
* NodeType storage controller.
* NodeType storage handler.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -27,7 +27,7 @@ class OverviewTerms extends FormBase {
protected $moduleHandler;
/**
* The term storage controller.
* The term storage handler.
*
* @var \Drupal\taxonomy\TermStorageInterface
*/
......
......@@ -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 {
......
......@@ -12,7 +12,7 @@
use Drupal\Core\Entity\EntityViewBuilder;
/**
* Render controller for taxonomy terms.
* View builder handler for taxonomy terms.
*/
class TermViewBuilder extends EntityViewBuilder {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment