You are here

public static function GroupContentType::loadByContentPluginId in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/GroupContentType.php \Drupal\group\Entity\GroupContentType::loadByContentPluginId()

Loads group content type entities by their responsible plugin ID.

Parameters

string|string[] $plugin_id: The ID of the content enabler plugin or an array of plugin IDs. If more than one plugin ID is provided, this will load all of the group content types that match any of the provided plugin IDs.

Return value

\Drupal\group\Entity\GroupContentTypeInterface[] An array of group content type entities indexed by their IDs.

Overrides GroupContentTypeInterface::loadByContentPluginId

1 call to GroupContentType::loadByContentPluginId()
GroupContentUninstallValidator::hasGroupContent in src/UninstallValidator/GroupContentUninstallValidator.php
Determines if there is any group content for a content enabler plugin.

File

src/Entity/GroupContentType.php, line 183

Class

GroupContentType
Defines the Group content type configuration entity.

Namespace

Drupal\group\Entity

Code

public static function loadByContentPluginId($plugin_id) {

  /** @var \Drupal\group\Entity\Storage\GroupContentTypeStorageInterface $storage */
  $storage = \Drupal::entityTypeManager()
    ->getStorage('group_content_type');
  return $storage
    ->loadByContentPluginId($plugin_id);
}