You are here

function search_api_entity_property_info in Search API 7

Implements hook_entity_property_info().

File

./search_api.module, line 447
Provides a flexible framework for implementing search services.

Code

function search_api_entity_property_info() {
  $info['search_api_server']['properties'] = array(
    'id' => array(
      'label' => t('ID'),
      'type' => 'integer',
      'description' => t('The primary identifier for a server.'),
      'schema field' => 'id',
      'validation callback' => 'entity_metadata_validate_integer_positive',
    ),
    'name' => array(
      'label' => t('Name'),
      'type' => 'text',
      'description' => t('The displayed name for a server.'),
      'schema field' => 'name',
      'required' => TRUE,
    ),
    'machine_name' => array(
      'label' => t('Machine name'),
      'type' => 'token',
      'description' => t('The internally used machine name for a server.'),
      'schema field' => 'machine_name',
      'required' => TRUE,
    ),
    'description' => array(
      'label' => t('Description'),
      'type' => 'text',
      'description' => t('The displayed description for a server.'),
      'schema field' => 'description',
      'sanitize' => 'filter_xss',
    ),
    'class' => array(
      'label' => t('Service class'),
      'type' => 'text',
      'description' => t('The ID of the service class to use for this server.'),
      'schema field' => 'class',
      'required' => TRUE,
    ),
    'enabled' => array(
      'label' => t('Enabled'),
      'type' => 'boolean',
      'description' => t('A flag indicating whether the server is enabled.'),
      'schema field' => 'enabled',
    ),
    'status' => array(
      'label' => t('Status'),
      'type' => 'integer',
      'description' => t('Search API server status property'),
      'schema field' => 'status',
      'options list' => 'search_api_status_options_list',
    ),
    'module' => array(
      'label' => t('Module'),
      'type' => 'text',
      'description' => t('The name of the module from which this server originates.'),
      'schema field' => 'module',
    ),
  );
  $info['search_api_index']['properties'] = array(
    'id' => array(
      'label' => t('ID'),
      'type' => 'integer',
      'description' => t('An integer identifying the index.'),
      'schema field' => 'id',
      'validation callback' => 'entity_metadata_validate_integer_positive',
    ),
    'name' => array(
      'label' => t('Name'),
      'type' => 'text',
      'description' => t('A name to be displayed for the index.'),
      'schema field' => 'name',
      'required' => TRUE,
    ),
    'machine_name' => array(
      'label' => t('Machine name'),
      'type' => 'token',
      'description' => t('The internally used machine name for an index.'),
      'schema field' => 'machine_name',
      'required' => TRUE,
    ),
    'description' => array(
      'label' => t('Description'),
      'type' => 'text',
      'description' => t("A string describing the index' use to users."),
      'schema field' => 'description',
      'sanitize' => 'filter_xss',
    ),
    'server' => array(
      'label' => t('Server ID'),
      'type' => 'token',
      'description' => t('The machine name of the search_api_server with which data should be indexed.'),
      'schema field' => 'server',
    ),
    'server_entity' => array(
      'label' => t('Server'),
      'type' => 'search_api_server',
      'description' => t('The search_api_server with which data should be indexed.'),
      'getter callback' => 'search_api_index_get_server',
    ),
    'item_type' => array(
      'label' => t('Item type'),
      'type' => 'token',
      'description' => t('The type of items stored in this index.'),
      'schema field' => 'item_type',
      'required' => TRUE,
    ),
    'enabled' => array(
      'label' => t('Enabled'),
      'type' => 'boolean',
      'description' => t('A flag indicating whether the index is enabled.'),
      'schema field' => 'enabled',
    ),
    'read_only' => array(
      'label' => t('Read only'),
      'type' => 'boolean',
      'description' => t('A flag indicating whether the index is read-only.'),
      'schema field' => 'read_only',
    ),
    'status' => array(
      'label' => t('Status'),
      'type' => 'integer',
      'description' => t('Search API index status property'),
      'schema field' => 'status',
      'options list' => 'search_api_status_options_list',
    ),
    'module' => array(
      'label' => t('Module'),
      'type' => 'text',
      'description' => t('The name of the module from which this index originates.'),
      'schema field' => 'module',
    ),
  );
  return $info;
}