class MediaStorage
Same name and namespace in other branches
- 10 core/modules/media/src/MediaStorage.php \Drupal\media\MediaStorage
- 11.x core/modules/media/src/MediaStorage.php \Drupal\media\MediaStorage
- 8.9.x core/modules/media/src/MediaStorage.php \Drupal\media\MediaStorage
Defines the storage handler class for media.
The default storage is overridden to handle metadata fetching outside of the database transaction.
Hierarchy
- class \Drupal\Core\Entity\EntityHandlerBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Entity\EntityStorageBase implements \Drupal\Core\Entity\EntityStorageInterface, \Drupal\Core\Entity\EntityHandlerInterface extends \Drupal\Core\Entity\EntityHandlerBase
- class \Drupal\Core\Entity\ContentEntityStorageBase implements \Drupal\Core\Entity\ContentEntityStorageInterface, \Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface, \Drupal\Core\Entity\BundleEntityStorageInterface extends \Drupal\Core\Entity\EntityStorageBase
- class \Drupal\Core\Entity\Sql\SqlContentEntityStorage implements \Drupal\Core\Entity\Sql\SqlEntityStorageInterface, \Drupal\Core\Entity\Schema\DynamicallyFieldableEntityStorageSchemaInterface, \Drupal\Core\Entity\EntityBundleListenerInterface extends \Drupal\Core\Entity\ContentEntityStorageBase
- class \Drupal\media\MediaStorage extends \Drupal\Core\Entity\Sql\SqlContentEntityStorage
- class \Drupal\Core\Entity\Sql\SqlContentEntityStorage implements \Drupal\Core\Entity\Sql\SqlEntityStorageInterface, \Drupal\Core\Entity\Schema\DynamicallyFieldableEntityStorageSchemaInterface, \Drupal\Core\Entity\EntityBundleListenerInterface extends \Drupal\Core\Entity\ContentEntityStorageBase
- class \Drupal\Core\Entity\ContentEntityStorageBase implements \Drupal\Core\Entity\ContentEntityStorageInterface, \Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface, \Drupal\Core\Entity\BundleEntityStorageInterface extends \Drupal\Core\Entity\EntityStorageBase
- class \Drupal\Core\Entity\EntityStorageBase implements \Drupal\Core\Entity\EntityStorageInterface, \Drupal\Core\Entity\EntityHandlerInterface extends \Drupal\Core\Entity\EntityHandlerBase
Expanded class hierarchy of MediaStorage
File
-
core/
modules/ media/ src/ MediaStorage.php, line 14
Namespace
Drupal\mediaView source
class MediaStorage extends SqlContentEntityStorage {
/**
* {@inheritdoc}
*/
public function save(EntityInterface $media) {
// For backwards compatibility, modules that override the Media entity
// class, are not required to implement the prepareSave() method.
// @todo For Drupal 8.7, consider throwing a deprecation notice if the
// method doesn't exist. See
// https://www.drupal.org/project/drupal/issues/2992426 for further
// discussion.
if (method_exists($media, 'prepareSave')) {
$media->prepareSave();
}
return parent::save($media);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.