function hook_query_file_entity_access_alter in File Entity (fieldable files) 8.2
Same name and namespace in other branches
- 7.3 file_entity.api.php \hook_query_file_entity_access_alter()
- 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
File
- ./
file_entity.api.php, line 21 - Hooks provided by the File Entity module.
Code
function hook_query_file_entity_access_alter(AlterableInterface $query) {
// Only show files that have been uploaded more than an hour ago.
$query
->condition('timestamp', \Drupal::time()
->getRequestTime() - 3600, '<=');
}