code: private function fetchResourcesForGivenIds(array $resourceIds, string $type, string $locale = null): array
      {
          $resources = [];
          $resourcePoolOptions = ['locale' => $locale];
          foreach ($resourceIds as $index => $resourceId) {
              if ($this->resourcePool->has($type, $resourceId, $resourcePoolOptions)) {
                  $resources[] = $this->resourcePool->get($type, $resourceId, $resourcePoolOptions);
  
                  unset($resourceIds[$index]);
              }
          }
  
          foreach ($this->createIdChunks($resourceIds) as $chunk) {
              $resources += $this->fetchCollectionFromApi($chunk, $type, $locale);
          }
  
          return $resources;
      }
docs: Loads resources in the current cache pool and fetches the missing ones from the API.
  
  @param array       $resourceIds
  @param string      $type
  @param string|null $locale
  
  @return ResourceInterface[]