You are here

interface LinkitSearchPluginInterface in Linkit 7.3

Defines a common interface for a Linkit search plugin.

Hierarchy

Expanded class hierarchy of LinkitSearchPluginInterface

All classes that implement LinkitSearchPluginInterface

File

includes/search_plugin.class.php, line 12
Linkit Search plugin interface.

View source
interface LinkitSearchPluginInterface {

  /**
   * Search plugin factory method.
   *
   * @param $plugin
   *   A search plugin object.
   *
   * @param LinkitProfile $profile
   *   (optional) A LinkitProfile object.
   *
   * @return
   *   An instance of the search plugin class or an instance of the
   *   LinkitSearchPluginBroken class.
   */
  public static function factory($plugin, LinkitProfile $profile);

  /**
   * Return a string representing this handler's name in the UI.
   */
  public function ui_title();

  /**
   * Return a string representing this handler's description in the UI.
   */
  public function ui_description();

  /**
   * Fetch search results based on the $search_string.
   *
   * @param $search_string
   *   A string that contains the text to search for.
   *
   * @return
   *   An associative array whose values are an
   *   associative array containing:
   *   - title: A string to use as the search result label.
   *   - description: (optional) A string with additional information about the
   *     result item.
   *   - path: The URL to the item.
   *   - group: (optional) A string with the group name for the result item.
   *     Best practice is to use the plugin name as group name.
   *   - addClass: (optional) A string with classes to add to the result row..
   */
  public function fetchResults($search_string);

}

Members

Namesort descending Modifiers Type Description Overrides
LinkitSearchPluginInterface::factory public static function Search plugin factory method. 1
LinkitSearchPluginInterface::fetchResults public function Fetch search results based on the $search_string. 2
LinkitSearchPluginInterface::ui_description public function Return a string representing this handler's description in the UI. 1
LinkitSearchPluginInterface::ui_title public function Return a string representing this handler's name in the UI. 1