You are here

public static function BrightcoveCmsEntity::loadMultipleByApiClient in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/Entity/BrightcoveCmsEntity.php \Drupal\brightcove\Entity\BrightcoveCmsEntity::loadMultipleByApiClient()
  2. 3.x src/Entity/BrightcoveCmsEntity.php \Drupal\brightcove\Entity\BrightcoveCmsEntity::loadMultipleByApiClient()

Load multiple CMS Entity for the given api client.

Parameters

string $api_client: The ID of the BrightcoveAPIClient entity.

bool $status: The status of the entity, if TRUE then published entities will be returned, otherwise the unpublished entities.

Return value

\Drupal\brightcove\Entity\BrightcoveCmsEntity[] An array of BrightcoveCMSEntity objects.

File

src/Entity/BrightcoveCmsEntity.php, line 154

Class

BrightcoveCmsEntity
Common base class for CMS entities like Video and Playlist.

Namespace

Drupal\brightcove\Entity

Code

public static function loadMultipleByApiClient($api_client, $status = TRUE) {
  $repository = \Drupal::getContainer()
    ->get('entity_type.repository');
  $entity_ids = \Drupal::entityQuery($repository
    ->getEntityTypeFromClass(get_called_class()))
    ->condition('api_client', $api_client)
    ->condition('status', $status ? 1 : 0)
    ->execute();
  return self::loadMultiple($entity_ids);
}