diff --git a/core/modules/rest/src/Entity/RestEndpoint.php b/core/modules/rest/src/Entity/RestEndpoint.php index f1b7a30..332613b 100644 --- a/core/modules/rest/src/Entity/RestEndpoint.php +++ b/core/modules/rest/src/Entity/RestEndpoint.php @@ -85,7 +85,7 @@ public function getResourcePluginID() { * {@inheritdoc} */ public function getResourcePlugin() { - return $this->getPluginCollections()['resource']->get($this->getResourcePluginID()); + return $this->pluginManager->createInstance($this->getResourcePluginID()); } /** @@ -212,20 +212,6 @@ public function removeSupportedFormat($method, $format) { } /** - * Returns the plugin collections used by this entity. - * - * @return \Drupal\Component\Plugin\LazyPluginCollection[] - * An array of plugin collections, keyed by the property name they use to - * store their configuration. - */ - public function getPluginCollections() { - $plugin_configuration = [ $this->getResourcePluginID() => [ 'id' => $this->getResourcePluginID() ] ]; - return [ - 'resource' => new DefaultLazyPluginCollection($this->pluginManager, $plugin_configuration) - ]; - } - - /** * Normalize the method to upper case and check validity. * * @param string $method The request method diff --git a/core/modules/rest/src/RestEndpointInterface.php b/core/modules/rest/src/RestEndpointInterface.php index b594f4b..734dd82 100644 --- a/core/modules/rest/src/RestEndpointInterface.php +++ b/core/modules/rest/src/RestEndpointInterface.php @@ -5,7 +5,7 @@ use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; -interface RestEndpointInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface { +interface RestEndpointInterface extends ConfigEntityInterface { /** * Retrieves the plugin id of the resource for this REST endpoint. *