You are here

function _filefield_paths_create_redirect in File (Field) Paths 8

Same name and namespace in other branches
  1. 7 filefield_paths.module \_filefield_paths_create_redirect()

Creates a redirect for a moved File field.

Parameters

string $source: The source file URL.

string $path: The moved file URL.

\Drupal\Core\Language\Language $language: The language of the source file.

Deprecated

in filefield_paths:1.0.0 and will be removed before filefield_paths:2.0.0. Use \Drupal\filefield_paths\RedirectInterface::createRedirect() instead.

File

./filefield_paths.module, line 396
Contains core functions for the File (Field) Paths module.

Code

function _filefield_paths_create_redirect($source, $path, Language $language) {
  @trigger_error('_filefield_paths_create_redirect() is deprecated in filefield_paths:1.0.0 and will be removed before filefield_paths:2.0.0. Use \\Drupal\\filefield_paths\\RedirectInterface::createRedirect() instead.', E_USER_DEPRECATED);
  \Drupal::service('filefield_paths.redirect')
    ->createRedirect($source, $path, $language);
}