1 EntityReferenceSelectionHandlerGeneric.inc | public EntityReferenceSelectionHandlerGeneric_file::entityFieldQueryAlter(SelectQueryInterface $query) |
Implements EntityReferenceHandler::entityFieldQueryAlter().
Overrides EntityReferenceSelectionHandlerGeneric::entityFieldQueryAlter
File
- core/
modules/ entityreference/ plugins/ selection/ EntityReferenceSelectionHandlerGeneric.inc, line 494 - Generic Entity handler.
Class
- EntityReferenceSelectionHandlerGeneric_file
- Override for the File entity type.
Code
public function entityFieldQueryAlter(SelectQueryInterface $query) {
// Need to know about 'permanent' vs. 'temporary' files.
$tables = $query->getTables();
$base_table = key($tables);
$query->condition('status', FILE_STATUS_PERMANENT);
// Access control to files is a very difficult business.
// @todo: Fix this when file access control is implemented.
// @see File::access().
return $query;
}