You are here

public function SearchApiAttachmentsParagraphsAlterSettings::propertyInfo in Search API attachments 7

Adds attachments property.

Return value

array containing the property.

Overrides SearchApiAttachmentsAlterSettings::propertyInfo

File

contrib/search_api_attachments_paragraphs/includes/callback_attachments_paragraphs_settings.inc, line 72
Search API data alteration callback.

Class

SearchApiAttachmentsParagraphsAlterSettings

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;
}