
| Current Path : /var/www/html/ift/web/core/modules/media/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/ift/web/core/modules/media/src/MediaStorage.php |
<?php
namespace Drupal\media;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
/**
* Defines the storage handler class for media.
*
* The default storage is overridden to handle metadata fetching outside of the
* database transaction.
*/
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);
}
}