Class Drupal\Core\Entity\Annotation\EntityType has some information in its documentation header about where to get information about how to annotate it:

Entity type plugins use an object-based annotation method, rather than an array-type annotation method (as commonly used on other annotation types). The annotation properties of entity types are found on \Drupal\Core\Entity\EntityType and are accessed using get/set methods defined in \Drupal\Core\Entity\EntityTypeInterface.

Task 1:
The ContentEntityType and ConfigEntityType annotation classes need to have similar documentation added (with links to their own classes/interfaces substituted for the base EntityType classes).

Task 2:
All 3 entity type annotation classes need to have

@ingroup entity_api

added to their documentation headers, so that they'll link to (and be listed on) the Entity API topic page.

Note that this @ingroup and additional documentation needs to go *before* the @Annotation (that always needs to come last in any documentation header).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

er.pushpinderrana’s picture

Status: Active » Needs review
FileSize
2.21 KB

@jhodgdon, Completed Task1 and Task2 from my end. Please review attached patch and share your feedback.

jhodgdon’s picture

Status: Needs review » Needs work

Yes, that's what we're looking for!

A couple of things to fix:

a) Documentation lines should never go over 80 characters, so the new docs added to the two Annotation classes need to have their lines rewrapped.

b) I do not think the interface is correct in the Config annotation:

+ * \Drupal\Core\Config\Entity\ConfigEntityType and are accessed using get/set methods defined
+ * in \Drupal\Core\Config\Entity\ConfigEntityInterface.

ConfigEntityInterface is the interface for config entities, not config entity types (which apparently do not have their own interface -- they just use \Drupal\Core\Entity\EntityTypeInterface for their get/set methods).

Thanks!

er.pushpinderrana’s picture

Status: Needs work » Needs review
FileSize
2.2 KB

Thankyou for your valuable feedback.

Followed your tips in this patch, please have a look once.

jhodgdon’s picture

Status: Needs review » Needs work

Oh, I just noticed one more thing: The Annotation classes have @see to themselves:

 * @see \Drupal\Core\Entity\Annotation\ConfigEntityType
+ *
+ * @ingroup entity_api
+ *
  * @Annotation
  */
 class ConfigEntityType extends EntityType {

Same for Content one. Those can be taken out.

Oh, I see that was taken from the EntityType annotation class. It should be taken out of that too. There is no point in having a @see link to the same class! :)

The rest looks great, thanks!

er.pushpinderrana’s picture

Status: Needs work » Needs review
FileSize
2.16 KB

Removed @see from all three, please verify.

jhodgdon’s picture

Status: Needs review » Fixed

Looks great! Thanks! Committed to 8.x.

  • Commit 9c4db60 on 8.x by jhodgdon:
    Issue #2288507 by er.pushpinderrana: Add documentation to entity type...
jhodgdon’s picture

@er.pushpinderrana: There is a new issue that you might be interested in: #2288499: Action plugin classes need more docs links

It is kind of similar to this one in some ways, but a little different. I tried to write up a good summary of what needs to be done... We will have a lot more like it soon, so I was hoping someone would try to follow the tasks there and then we can make the instructions better for the rest of the issues, if they are not clear. So... If you are interested, that would be great! Thanks for all the recent patches too!

er.pushpinderrana’s picture

Definitely I am interested for rest of issues too, let me assigned #2288499 to me.

We will have a lot more like it soon, so I was hoping someone would try to follow the tasks there

Yes I am ready to do work for these issues.

Thank you for your suggestion.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.