You are here

public function ServiceEndpoint::loadResourceProvider in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/Entity/ServiceEndpoint.php \Drupal\services\Entity\ServiceEndpoint::loadResourceProvider()

Load service resource provider.

Parameters

string $plugin_id: Service plugin identifier.

Return value

\Drupal\services\Entity\ServiceEndpointResource A service resource object; otherwise FALSE.

Overrides ServiceEndpointInterface::loadResourceProvider

File

src/Entity/ServiceEndpoint.php, line 86

Class

ServiceEndpoint
Defines the service endpoint entity.

Namespace

Drupal\services\Entity

Code

public function loadResourceProvider($plugin_id) {
  $entities = $this
    ->getResourceStorage()
    ->loadByProperties([
    'service_plugin_id' => $plugin_id,
    'service_endpoint_id' => $this
      ->id(),
  ]);
  return !empty($entities) ? reset($entities) : FALSE;
}