You are here

public function BynderApiTest::getMediaInfo in Bynder 8.3

Same name and namespace in other branches
  1. 8 tests/modules/bynder_test_module/src/BynderApiTest.php \Drupal\bynder_test_module\BynderApiTest::getMediaInfo()
  2. 8.2 tests/modules/bynder_test_module/src/BynderApiTest.php \Drupal\bynder_test_module\BynderApiTest::getMediaInfo()
  3. 4.0.x tests/modules/bynder_test_module/src/BynderApiTest.php \Drupal\bynder_test_module\BynderApiTest::getMediaInfo()

Returns value set in state.

Parameters

string $media_uuid: The media UUID.

Return value

mixed Returns what is set in the state.

File

tests/modules/bynder_test_module/src/BynderApiTest.php, line 42

Class

BynderApiTest
Bynder API test service.

Namespace

Drupal\bynder_test_module

Code

public function getMediaInfo($media_uuid) {
  if ($media_info = $this->state
    ->get('bynder.bynder_test_media_info')) {
    return $media_info;
  }
  if ($media_list = $this->state
    ->get('bynder.bynder_test_media_list')) {
    foreach ($media_list['media'] as $media_info) {
      if ($media_uuid == $media_info['id']) {
        return $media_info;
      }
    }
  }
}