You are here

public function Group::getContentByEntityId in Group 8

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

Retrieves all GroupContent entities for a specific entity.

Parameters

string $plugin_id: A content enabler plugin ID to filter on.

int $id: The ID of the entity to retrieve the GroupContent entities for.

Return value

\Drupal\group\Entity\GroupContentInterface[] A list of GroupContent entities matching the criteria.

Overrides GroupInterface::getContentByEntityId

File

src/Entity/Group.php, line 170

Class

Group
Defines the Group entity.

Namespace

Drupal\group\Entity

Code

public function getContentByEntityId($plugin_id, $id) {
  return $this
    ->getContent($plugin_id, [
    'entity_id' => $id,
  ]);
}