FileUsed.php

Same filename in other branches
  1. 10 core/modules/file/tests/modules/file_test_get_ids/src/Plugin/migrate/source/d7/FileUsed.php
  2. 11.x core/modules/file/tests/modules/file_test_get_ids/src/Plugin/migrate/source/d7/FileUsed.php

Namespace

Drupal\file_test_get_ids\Plugin\migrate\source\d7

File

core/modules/file/tests/modules/file_test_get_ids/src/Plugin/migrate/source/d7/FileUsed.php

View source
<?php

namespace Drupal\file_test_get_ids\Plugin\migrate\source\d7;

use Drupal\file\Plugin\migrate\source\d7\File;

/**
 * Drupal 7 file source from database restricted to used files.
 *
 * @MigrateSource(
 *   id = "d7_file_used",
 *   source_module = "file"
 * )
 */
class FileUsed extends File {
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        $query = parent::query();
        // Join on file_usage table to only migrate used files.
        $query->innerJoin('file_usage', 'fu', 'f.fid = fu.fid');
        return $query;
    }

}

Classes

Title Deprecated Summary
FileUsed Drupal 7 file source from database restricted to used files.

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