You are here

interface NotificationPluginInterface in Search API Saved Searches 8

Provides an interface for notification plugins.

Hierarchy

Expanded class hierarchy of NotificationPluginInterface

All classes that implement NotificationPluginInterface

See also

\Drupal\search_api_saved_searches\Annotation\SearchApiSavedSearchesNotification

\Drupal\search_api_saved_searches\Notification\NotificationPluginManager

\Drupal\search_api_saved_searches\Notification\NotificationPluginBase

Plugin API

2 files declare their use of NotificationPluginInterface
SavedSearchType.php in src/Entity/SavedSearchType.php
SavedSearchTypeInterface.php in src/SavedSearchTypeInterface.php

File

src/Notification/NotificationPluginInterface.php, line 21

Namespace

Drupal\search_api_saved_searches\Notification
View source
interface NotificationPluginInterface extends ConfigurablePluginInterface {

  /**
   * Retrieves the saved search type.
   *
   * @return \Drupal\search_api_saved_searches\SavedSearchTypeInterface
   *   The saved search type to which this plugin is attached.
   */
  public function getSavedSearchType();

  /**
   * Sets the saved search type.
   *
   * @param \Drupal\search_api_saved_searches\SavedSearchTypeInterface $type
   *   The new saved search type for this plugin.
   *
   * @return $this
   */
  public function setSavedSearchType(SavedSearchTypeInterface $type);

  /**
   * Retrieves the field definitions to add to saved searches for this plugin.
   *
   * The field definitions will be added to all bundles for which this
   * notification plugin is active.
   *
   * If an existing plugin's field definitions change in any way, it is the
   * providing module's responsibility to provide an update hook calling field
   * storage definition listener's CRUD methods as appropriate.
   *
   * @return \Drupal\search_api_saved_searches\BundleFieldDefinition[]
   *   An array of bundle field definitions, keyed by field name.
   */
  public function getFieldDefinitions();

  /**
   * Retrieves default form display settings for the plugin's custom fields.
   *
   * @return array
   *   An associative array of form display settings, keyed by field names
   *   defined by this plugin. Fields can easily be hidden by default by just
   *   omitting them from this array.
   */
  public function getDefaultFieldFormDisplay();

  /**
   * Checks access to an operation on a given entity field.
   *
   * This method will only be called for fields defined by this plugin and can
   * be used to implement custom access restrictions for those fields.
   *
   * @param string $operation
   *   The operation access should be checked for.
   *   Usually one of "view" or "edit".
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user session for which to check access.
   * @param \Drupal\Core\Field\FieldItemListInterface $items
   *   (optional) The field values for which to check access, or NULL if access
   *   is checked for the field definition, without any specific value
   *   available.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   *
   * @see \Drupal\search_api_saved_searches\Entity\SavedSearchAccessControlHandler::checkFieldAccess()
   */
  public function checkFieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL);

  /**
   * Notifies the search's owner of new results.
   *
   * @param \Drupal\search_api_saved_searches\SavedSearchInterface $search
   *   The saved search for which to report new results.
   * @param \Drupal\search_api\Query\ResultSetInterface $results
   *   The new results.
   */
  public function notify(SavedSearchInterface $search, ResultSetInterface $results);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
ConfigurablePluginInterface::getDescription public function Returns the plugin's description. 1
ConfigurablePluginInterface::label public function Returns the label for use on the administration pages. 1
ConfigurablePluginInterface::onDependencyRemoval public function Informs the plugin that some of its dependencies are being removed. 1
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
HideablePluginInterface::isHidden public function Determines whether this plugin should be hidden in the UI. 1
NotificationPluginInterface::checkFieldAccess public function Checks access to an operation on a given entity field. 1
NotificationPluginInterface::getDefaultFieldFormDisplay public function Retrieves default form display settings for the plugin's custom fields. 1
NotificationPluginInterface::getFieldDefinitions public function Retrieves the field definitions to add to saved searches for this plugin. 1
NotificationPluginInterface::getSavedSearchType public function Retrieves the saved search type. 1
NotificationPluginInterface::notify public function Notifies the search's owner of new results. 1
NotificationPluginInterface::setSavedSearchType public function Sets the saved search type. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2