access('update', $account, TRUE); return $return_as_object ? $access : $access->isAllowed(); } /** * {@inheritdoc} */ public function execute(ContentEntityInterface $entity = NULL): void { if ($entity->bundle() == 'able_player_caption') { $file = $entity->get('ableplayer_caption')->entity; $uri = $file->getFileUri(); $contents = file_get_contents(\Drupal::service('file_system')->realpath($uri)); $entity->set('field_extracted_transcription', $contents); $entity->save(); } } }