You are here

public static function BrightcoveCmsEntity::loadMultipleByApiClient in Brightcove Video Connect 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/BrightcoveCmsEntity.php \Drupal\brightcove\Entity\BrightcoveCmsEntity::loadMultipleByApiClient()
  2. 8 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.

Throws

\Drupal\Core\Entity\Exception\AmbiguousEntityClassException

\Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException

File

src/Entity/BrightcoveCmsEntity.php, line 157

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);
}