You are here

function _media_update_original_file in Media Update 7.2

Same name and namespace in other branches
  1. 7 media_update.module \_media_update_original_file()

Helper function to provide a static cache of our original file so that it can be referenced outside of the form context (aka in file_presave).

Parameters

object $original_file: A file object to store temporarily.

3 calls to _media_update_original_file()
media_update_file_presave in ./media_update.module
Implements hook_file_presave().
media_update_presubmit in ./media_update.module
Provides submit handling based on hook_media_update_params.
media_update_validate in ./media_update.module
Provides validation based on hook_media_update_params.

File

./media_update.module, line 135
Defines the module media_update.

Code

function _media_update_original_file($original_file = NULL, $reset = FALSE) {
  static $file;
  if (!empty($original_file) || $reset) {
    $file = $original_file;
  }
  return $file;
}