You are here

interface Drupal_RichSnippets_SchemaPreprocessorInterface in Rich Snippets 7

Interface implemented by all Rich Snippets preprocessor classes.

Preprocessors generally take data from the fields marked with shcmeata and properties and append them to a template variable.

Hierarchy

Expanded class hierarchy of Drupal_RichSnippets_SchemaPreprocessorInterface

All classes that implement Drupal_RichSnippets_SchemaPreprocessorInterface

File

lib/Drupal/RichSnippets/SchemaPreprocessorInterface.php, line 14
Contains Drupal_RichSnippets_SchemaPreprocessorInterface.

View source
interface Drupal_RichSnippets_SchemaPreprocessorInterface {

  /**
   * Constructs a Drupal_RichSnippets_SchemaPreprocessorInterface object.
   *
   * @param array &$variables
   *   An associative array of template variables.
   */
  public function __construct(array &$variables);

  /**
   * Returns an associative array of field names to values associated with the
   * passed schema or property.
   *
   * The field names are the names as stored in the object returned by the
   * search backend. For example, the Apache Solr Search Integration will use
   * the field names as stored in Solr and not the Field API names.
   *
   * @param string $schema
   *   The normalized schema associated with the search result.
   *
   * @return array
   *   An associative array keyed by field names to values.
   */
  public function getSchemaFields($schema);

  /**
   * Adds fields of the passed schema to the image section.
   *
   * It is expected that the fields contains the URI to the resource. The
   * processed data is added to $variables['image'].
   *
   * @param string $schema
   *   The normalized schema associated with the search result.
   */
  public function addImage($schema);

  /**
   * Adds fields of the passed schema to the info section.
   *
   * It is expected that the fields contains a timestamp of some sort. The
   * processed data is added to the $variables['info_split'] array.
   *
   * @param string $schema
   *   The normalized schema associated with the search result.
   */
  public function addDateToInfo($schema);

  /**
   * Adds the text in fields of the passed schema to the info section.
   *
   * It is expected that the fields contains a string. The processed data is
   * added to the $variables['info_split'] array.
   *
   * @param string $schema
   *   The normalized schema associated with the search result.
   */
  public function addTextToInfo($schema);

}

Members

Namesort descending Modifiers Type Description Overrides
Drupal_RichSnippets_SchemaPreprocessorInterface::addDateToInfo public function Adds fields of the passed schema to the info section. 2
Drupal_RichSnippets_SchemaPreprocessorInterface::addImage public function Adds fields of the passed schema to the image section. 2
Drupal_RichSnippets_SchemaPreprocessorInterface::addTextToInfo public function Adds the text in fields of the passed schema to the info section. 2
Drupal_RichSnippets_SchemaPreprocessorInterface::getSchemaFields public function Returns an associative array of field names to values associated with the passed schema or property. 2
Drupal_RichSnippets_SchemaPreprocessorInterface::__construct public function Constructs a Drupal_RichSnippets_SchemaPreprocessorInterface object. 2