function AddFormBase::prepareMediaEntityForSave

Same name in other branches
  1. 9 core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::prepareMediaEntityForSave()
  2. 8.9.x core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::prepareMediaEntityForSave()
  3. 11.x core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::prepareMediaEntityForSave()

Prepares a created media item to be permanently saved.

Parameters

\Drupal\media\MediaInterface $media: The unsaved media item.

1 call to AddFormBase::prepareMediaEntityForSave()
AddFormBase::submitForm in core/modules/media_library/src/Form/AddFormBase.php
Form submission handler.
1 method overrides AddFormBase::prepareMediaEntityForSave()
FileUploadForm::prepareMediaEntityForSave in core/modules/media_library/src/Form/FileUploadForm.php
Prepares a created media item to be permanently saved.

File

core/modules/media_library/src/Form/AddFormBase.php, line 548

Class

AddFormBase
Provides a base class for creating media items from within the media library.

Namespace

Drupal\media_library\Form

Code

protected function prepareMediaEntityForSave(MediaInterface $media) {
    // Intentionally empty by default.
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.