You are here

protected function SearchApiAttachmentsAlterSettings::isPrivate in Search API attachments 7

Check if the file is private.

Parameters

array $file: A file array.

Return value

bool TRUE if the file is private. FALSE otherwise.

4 calls to SearchApiAttachmentsAlterSettings::isPrivate()
SearchApiAttachmentsAlterSettings::isFileIndexable in includes/callback_attachments_settings.inc
Checks if file is allowed to be indexed.
SearchApiAttachmentsCommentAlterSettings::alterItems in contrib/search_api_attachments_comment/includes/callback_attachments_comment_settings.inc
Alter items before indexing.
SearchApiAttachmentsEntityreferenceAlterSettings::getFilesContent in contrib/search_api_attachments_entityreference/includes/callback_attachments_entityreference_settings.inc
Extracts and returns contents of files.
SearchApiAttachmentsMultipleEntitiesAlterSettings::alterItems in contrib/search_api_attachments_multiple_entities/includes/callback_attachments_multiple_entities_settings.inc
Alter items before indexing.

File

includes/callback_attachments_settings.inc, line 615
Search API data alteration callback.

Class

SearchApiAttachmentsAlterSettings
Indexes files content.

Code

protected function isPrivate(array $file) {
  $result = FALSE;
  $wrapper = 'private://';
  $uri = $file['uri'];
  if (substr($uri, 0, 10) == $wrapper) {
    $result = TRUE;
  }
  return $result;
}