You are here

class FileEntityType in Media Migration 8

File Entity Type source plugin.

Plugin annotation


@MigrateSource(
  id = "d7_file_entity_type",
  source_module = "file_entity"
)

Hierarchy

Expanded class hierarchy of FileEntityType

File

src/Plugin/migrate/source/d7/FileEntityType.php, line 15

Namespace

Drupal\media_migration\Plugin\migrate\source\d7
View source
class FileEntityType extends FileEntityConfigSourceBase {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    [
      'types' => $types,
      'schemes' => $schemes,
    ] = $row
      ->getSource();
    $type = explode(static::MULTIPLE_SEPARATOR, $types)[0];
    $scheme = explode(static::MULTIPLE_SEPARATOR, $schemes)[0];
    if (!($dealer_plugin = $this->fileEntityDealerManager
      ->createInstanceFromTypeAndScheme($type, $scheme))) {
      return FALSE;
    }
    $dealer_plugin
      ->prepareMediaTypeRow($row, $this
      ->getDatabase());
    return parent::prepareRow($row);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigSourceBase::MULTIPLE_SEPARATOR constant
FileEntityConfigSourceBase::$fileEntityDealerManager protected property The file entity dealer plugin manager.
FileEntityConfigSourceBase::create public static function
FileEntityConfigSourceBase::fields public function 3
FileEntityConfigSourceBase::getIds public function 2
FileEntityConfigSourceBase::initializeIterator protected function 2
FileEntityConfigSourceBase::prepareQuery protected function
FileEntityConfigSourceBase::query public function 1
FileEntityConfigSourceBase::__construct public function Constructs a plugin instance.
FileEntityType::prepareRow public function
MediaMigrationDatabaseTrait::getExtensionExpression protected function Returns the file extension expression for the current DB.
MediaMigrationDatabaseTrait::getFileEntityBaseQuery protected function Returns a base query for file entity types.
MediaMigrationDatabaseTrait::getFilePlainBaseQuery protected function Returns a base query for plain files.
MediaMigrationDatabaseTrait::getMainMimeTypeExpression protected function Returns the main MIME type's expression for the current DB.
MediaMigrationDatabaseTrait::getSchemeExpression protected function Returns the expression for the DB for getting the URI scheme.
MediaMigrationDatabaseTrait::getUserPictureOnlyFidsQuery protected function Returns the subquery for the user picture-only file IDs.
MediaMigrationDatabaseTrait::getWebformOrUserPictureOnlyFidsQuery protected function Subquery for FIDs used only in webform submissions and/or by user entities.