You are here

public function SearchApiAttachmentsCommentAlterSettings::propertyInfo in Search API attachments 7

Adds attachments property.

Return value

array containing the property.

Overrides SearchApiAttachmentsAlterSettings::propertyInfo

File

contrib/search_api_attachments_comment/includes/callback_attachments_comment_settings.inc, line 84
Search API data alteration callback.

Class

SearchApiAttachmentsCommentAlterSettings

Code

public function propertyInfo() {
  $ret = array();
  if ($this->index->item_type == 'file') {
    $ret['attachments_content'] = array(
      'label' => 'File content',
      'description' => 'File content',
      'type' => 'text',
    );
  }
  else {
    $fields = $this
      ->getFileFields();
    foreach ($fields as $name => $field) {
      $ret['attachments_' . $name] = array(
        'label' => 'Attachment content: ' . $name,
        'description' => $name,
        'type' => 'text',
      );
    }
  }
  return $ret;
}