getMethodsForMethodGranularity example


  public function getResourcePlugin() {
    return $this->getPluginCollections()['resource']->get($this->plugin_id);
  }

  /** * {@inheritdoc} */
  public function getMethods() {
    switch ($this->granularity) {
      case RestResourceConfigInterface::METHOD_GRANULARITY:
        return $this->getMethodsForMethodGranularity();

      case RestResourceConfigInterface::RESOURCE_GRANULARITY:
        return $this->configuration['methods'];

      default:
        throw new \InvalidArgumentException('Invalid granularity specified.');
    }
  }

  /** * Retrieves a list of supported HTTP methods for this resource. * * @return string[] * A list of supported HTTP methods. */
Home | Imprint | This part of the site doesn't use cookies.