You are here

interface ServiceDefinitionInterface in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/ServiceDefinitionInterface.php \Drupal\services\ServiceDefinitionInterface

Interface \Drupal\services\ServiceDefinitionInterface.

Hierarchy

Expanded class hierarchy of ServiceDefinitionInterface

All classes that implement ServiceDefinitionInterface

File

src/ServiceDefinitionInterface.php, line 16

Namespace

Drupal\services
View source
interface ServiceDefinitionInterface extends ContextAwarePluginInterface, CacheableDependencyInterface {

  /**
   * Returns a translated string for the service title.
   *
   * @return string
   */
  public function getTitle();

  /**
   * Returns a translated string for the category.
   *
   * @return string
   */
  public function getCategory();

  /**
   * Returns the appended path for the service.
   *
   * @return string
   */
  public function getPath();

  /**
   * Returns a translated description for the constraint description.
   *
   * @return string
   */
  public function getDescription();

  /**
   * Return an array of allowed methods.
   *
   * @return array
   */
  public function getMethods();

  /**
   * Returns an array of service request arguments.
   *
   * @return array
   */
  public function getArguments();

  /**
   * Returns a boolean if this service definition supports translations.
   *
   * @return bool
   */
  public function supportsTranslation();

  /**
   * Checks access for the ServiceDefintion.
   *
   * @param \Symfony\Component\Routing\Route $route
   *   The route match object.
   */
  public function processRoute(Route $route);

  /**
   * Processes the request and returns an array of data as appropriate.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The request object.
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The route match object.
   * @param \Symfony\Component\Serializer\SerializerInterface $serializer
   *   The serializer. Some methods might require the plugin to leverage the
   *   serializer after extracting the request contents.
   *
   * @return array
   *   The response.
   *
   * @throws \Symfony\Component\HttpKernel\Exception\HttpException
   */
  public function processRequest(Request $request, RouteMatchInterface $route_match, SerializerInterface $serializer);

  /**
   * Allow plugins to alter the response object before it is returned.
   *
   * @param \Symfony\Component\HttpFoundation\Response $response
   *   The response object that is about to be returned.
   */
  public function processResponse(Response $response);

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
ContextAwarePluginInterface::getContext public function Gets a defined context. 1
ContextAwarePluginInterface::getContextDefinition public function Gets a specific context definition of the plugin. Overrides ContextAwarePluginInterface::getContextDefinition
ContextAwarePluginInterface::getContextDefinitions public function Gets the context definitions of the plugin. Overrides ContextAwarePluginInterface::getContextDefinitions
ContextAwarePluginInterface::getContextMapping public function Gets a mapping of the expected assignment names to their context names. 1
ContextAwarePluginInterface::getContexts public function Gets the defined contexts. 1
ContextAwarePluginInterface::getContextValue public function Gets the value for a defined context. 1
ContextAwarePluginInterface::getContextValues public function Gets the values for all defined contexts. 1
ContextAwarePluginInterface::setContext public function Set a context on this plugin. 1
ContextAwarePluginInterface::setContextMapping public function Sets a mapping of the expected assignment names to their context names. 1
ContextAwarePluginInterface::setContextValue public function Sets the value for a defined context. 1
ContextAwarePluginInterface::validateContexts public function Validates the set values for the defined contexts. 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
ServiceDefinitionInterface::getArguments public function Returns an array of service request arguments. 1
ServiceDefinitionInterface::getCategory public function Returns a translated string for the category. 1
ServiceDefinitionInterface::getDescription public function Returns a translated description for the constraint description. 1
ServiceDefinitionInterface::getMethods public function Return an array of allowed methods. 1
ServiceDefinitionInterface::getPath public function Returns the appended path for the service. 1
ServiceDefinitionInterface::getTitle public function Returns a translated string for the service title. 1
ServiceDefinitionInterface::processRequest public function Processes the request and returns an array of data as appropriate. 10
ServiceDefinitionInterface::processResponse public function Allow plugins to alter the response object before it is returned. 1
ServiceDefinitionInterface::processRoute public function Checks access for the ServiceDefintion. 1
ServiceDefinitionInterface::supportsTranslation public function Returns a boolean if this service definition supports translations. 1