You are here

function hook_query_file_entity_access_alter in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 8.2 file_entity.api.php \hook_query_file_entity_access_alter()
  2. 7.2 file_entity.api.php \hook_query_file_entity_access_alter()

Control access to listings of files.

Parameters

object $query: A query object describing the composite parts of a SQL query related to listing files.

See also

hook_query_TAG_alter()

Related topics

File

./file_entity.api.php, line 210
Hooks provided by the File Entity module.

Code

function hook_query_file_entity_access_alter(QueryAlterableInterface $query) {

  // Only show files that have been uploaded more than an hour ago.
  $query
    ->condition('timestamp', REQUEST_TIME - 3600, '<=');
}