Unverified Commit d372f6d8 authored by larowlan's avatar larowlan
Browse files

Issue #2323459 by harsha012, jhodgdon, joachim: Change wording of annotation keys to properties

parent ed45b4d5
...@@ -331,11 +331,11 @@ ...@@ -331,11 +331,11 @@
* out-of-the-box support for Entity API's revisioning and publishing * out-of-the-box support for Entity API's revisioning and publishing
* features, which will allow your entity type to be used with Drupal's * features, which will allow your entity type to be used with Drupal's
* editorial workflow provided by the Content Moderation module. * editorial workflow provided by the Content Moderation module.
* - The 'id' annotation gives the entity type ID, and the 'label' annotation * - In the annotation, the 'id' property gives the entity type ID, and the
* gives the human-readable name of the entity type. If you are defining a * 'label' property gives the human-readable name of the entity type. If you
* content entity type that uses bundles, the 'bundle_label' annotation gives * are defining a content entity type that uses bundles, the 'bundle_label'
* the human-readable name to use for a bundle of this entity type (for * property gives the human-readable name to use for a bundle of this entity
* example, "Content type" for the Node entity). * type (for example, "Content type" for the Node entity).
* - The annotation will refer to several handler classes, which you will also * - The annotation will refer to several handler classes, which you will also
* need to define: * need to define:
* - list_builder: Define a class that extends * - list_builder: Define a class that extends
...@@ -354,16 +354,17 @@ ...@@ -354,16 +354,17 @@
* \Drupal\Core\Entity\EntityViewBuilderInterface (usually extending * \Drupal\Core\Entity\EntityViewBuilderInterface (usually extending
* \Drupal\Core\Entity\EntityViewBuilder), to display a single entity. * \Drupal\Core\Entity\EntityViewBuilder), to display a single entity.
* - translation: For translatable content entities (if the 'translatable' * - translation: For translatable content entities (if the 'translatable'
* annotation has value TRUE), define a class that extends * annotation property has value TRUE), define a class that extends
* \Drupal\content_translation\ContentTranslationHandler, to translate * \Drupal\content_translation\ContentTranslationHandler, to translate
* the content. Configuration translation is handled automatically by the * the content. Configuration translation is handled automatically by the
* Configuration Translation module, without the need of a handler class. * Configuration Translation module, without the need of a handler class.
* - access: If your configuration entity has complex permissions, you might * - access: If your configuration entity has complex permissions, you might
* need an access control handling, implementing * need an access control handling, implementing
* \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most entities * \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most
* can just use the 'admin_permission' annotation instead. Note that if you * entities can just use the 'admin_permission' annotation property
* are creating your own access control handler, you should override the * instead. Note that if you are creating your own access control handler,
* checkAccess() and checkCreateAccess() methods, not access(). * you should override the checkAccess() and checkCreateAccess() methods,
* not access().
* - storage: A class implementing * - storage: A class implementing
* \Drupal\Core\Entity\EntityStorageInterface. If not specified, content * \Drupal\Core\Entity\EntityStorageInterface. If not specified, content
* entities will use \Drupal\Core\Entity\Sql\SqlContentEntityStorage, and * entities will use \Drupal\Core\Entity\Sql\SqlContentEntityStorage, and
...@@ -396,25 +397,26 @@ ...@@ -396,25 +397,26 @@
* - delete-form: Confirmation form to delete the entity. * - delete-form: Confirmation form to delete the entity.
* - edit-form: Editing form. * - edit-form: Editing form.
* - Other link types specific to your entity type can also be defined. * - Other link types specific to your entity type can also be defined.
* - If your content entity is fieldable, provide 'field_ui_base_route' * - If your content entity is fieldable, provide the 'field_ui_base_route'
* annotation, giving the name of the route that the Manage Fields, Manage * annotation property, giving the name of the route that the Manage Fields,
* Display, and Manage Form Display pages from the Field UI module will be * Manage Display, and Manage Form Display pages from the Field UI module
* attached to. This is usually the bundle settings edit page, or an entity * will be attached to. This is usually the bundle settings edit page, or an
* type settings page if there are no bundles. * entity type settings page if there are no bundles.
* - If your content entity has bundles, you will also need to define a second * - If your content entity has bundles, you will also need to define a second
* plugin to handle the bundles. This plugin is itself a configuration entity * plugin to handle the bundles. This plugin is itself a configuration entity
* type, so follow the steps here to define it. The machine name ('id' * type, so follow the steps here to define it. The machine name ('id'
* annotation) of this configuration entity class goes into the * annotation property) of this configuration entity class goes into the
* 'bundle_entity_type' annotation on the entity type class. For example, for * 'bundle_entity_type' annotation property on the entity type class. For
* the Node entity, the bundle class is \Drupal\node\Entity\NodeType, whose * example, for the Node entity, the bundle class is
* machine name is 'node_type'. This is the annotation value for * \Drupal\node\Entity\NodeType, whose machine name is 'node_type'. This is
* 'bundle_entity_type' on the \Drupal\node\Entity\Node class. Also, the * the annotation property 'bundle_entity_type' on the
* bundle config entity type annotation must have a 'bundle_of' entry, * \Drupal\node\Entity\Node class. Also, the
* bundle config entity type annotation must have a 'bundle_of' property,
* giving the machine name of the entity type it is acting as a bundle for. * giving the machine name of the entity type it is acting as a bundle for.
* These machine names are considered permanent, they may not be renamed. * These machine names are considered permanent, they may not be renamed.
* - Additional annotations can be seen on entity class examples such as * - Additional annotation properties can be seen on entity class examples such
* \Drupal\node\Entity\Node (content) and \Drupal\user\Entity\Role * as \Drupal\node\Entity\Node (content) and \Drupal\user\Entity\Role
* (configuration). These annotations are documented on * (configuration). These annotation properties are documented on
* \Drupal\Core\Entity\EntityType. * \Drupal\Core\Entity\EntityType.
* *
* @section sec_routes Entity routes * @section sec_routes Entity routes
...@@ -500,8 +502,8 @@ ...@@ -500,8 +502,8 @@
* $storage = $container->get('entity.manager')->getStorage('your_entity_type'); * $storage = $container->get('entity.manager')->getStorage('your_entity_type');
* @endcode * @endcode
* Here, 'your_entity_type' is the machine name of your entity type ('id' * Here, 'your_entity_type' is the machine name of your entity type ('id'
* annotation on the entity class), and note that you should use dependency * annotation property on the entity class), and note that you should use
* injection to retrieve this object if possible. See the * dependency injection to retrieve this object if possible. See the
* @link container Services and Dependency Injection topic @endlink for more * @link container Services and Dependency Injection topic @endlink for more
* about how to properly retrieve services. * about how to properly retrieve services.
* *
......
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