setMediaSourceService($container->get('islandora.media_source_service')); return $instance; } /** * {@inheritdoc} */ protected function generateData(EntityInterface $entity) { $data = parent::generateData($entity); $data['source_field'] = $this->mediaSource->getSourceFieldName($entity->bundle()); return $data; } /** * Setter for the media source service. */ public function setMediaSourceService(MediaSourceService $media_source) { $this->mediaSource = $media_source; } }