- Issue created by @maskedjellybean
- 🇮🇹Italy apaderno Brescia, 🇮🇹
The source for the page on https://api.drupal.org/api/drupal is the core.api.php file in the Drupal core repository.
Being able to search for events on api.drupal.org is a feature request for the API module.
- 🇺🇸United States maskedjellybean Portland, OR
Thanks for moving this to the correct project.
Searching for "Subscriber" is not what I'm looking for. That will give you existing event subscribers, not events that can be subscribed to. You could find events that can be subscribed to that way, but it would be very time consuming. Plus it's theoretically possible for core to provide an event that is not subscribed to by core, meaning you wouldn't find it this way.
I have seen https://api.drupal.org/api/drupal/core%21core.api.php/group/events/11.x , but it's not accurate. For example
\Drupal\file\Validation\FileValidationEvent
is not listed. Is this list automatically generated or manually maintained? - 🇮🇹Italy apaderno Brescia, 🇮🇹
The list is automatically generated and it lists everything that contains
@Event
in a documentation comment. It is@Event
that is manually added (since documentation comments are written by human beings).core/lib/Drupal/Core/Session/AccountEvents.php
/** * Name of the event fired when the current user is set. * * This event allows modules to perform an action whenever the current user is * set. The event listener receives an \Drupal\Core\Session\AccountSetEvent * instance. * * @Event * * @see \Drupal\Core\Session\AccountSetEvent * @see \Drupal\Core\Session\AccountProxyInterface::setAccount() * * @var string */ const SET_USER = 'account.set';
core/modules/block_content/src/BlockContentEvents.php
/** * Name of the event when getting the dependency of a non-reusable block. * * This event allows modules to provide a dependency for non-reusable block * access if * \Drupal\block_content\Access\DependentAccessInterface::getAccessDependency() * did not return a dependency during access checking. * * @Event * * @see \Drupal\block_content\Event\BlockContentGetDependencyEvent * @see \Drupal\block_content\BlockContentAccessControlHandler::checkAccess() * * @var string */ const BLOCK_CONTENT_GET_DEPENDENCY = 'block_content.get_dependency';
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Actually, there are more projects involved.
The API module parses the documentation comments and provides lists of pages containing a documentation tag, for example
@Event
in this case.
The documentation comments are in the source of another project, such as Drupal core, in the case of pages listed under https://api.drupal.org/api/drupal.