You are here

interface CitationStylerInterface in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 src/CitationStylerInterface.php \Drupal\bibcite\CitationStylerInterface

Defines an interface for Styler service.

Hierarchy

Expanded class hierarchy of CitationStylerInterface

All classes that implement CitationStylerInterface

2 files declare their use of CitationStylerInterface
Citation.php in modules/bibcite_entity/src/Plugin/views/field/Citation.php
SettingsForm.php in src/Form/SettingsForm.php

File

src/CitationStylerInterface.php, line 11

Namespace

Drupal\bibcite
View source
interface CitationStylerInterface {

  /**
   * Render CSL data to bibliographic citation.
   *
   * @param array|\stdClass $data
   *   Array or object of values in CSL format.
   *
   * @return string
   *   Rendered bibliographic citation.
   */
  public function render($data);

  /**
   * Set processor plugin.
   *
   * @param \Drupal\bibcite\Plugin\BibCiteProcessorInterface $processor
   *   Processor plugin object.
   *
   * @return \Drupal\bibcite\CitationStylerInterface
   *   The called Styler object.
   */
  public function setProcessor(BibCiteProcessorInterface $processor);

  /**
   * Load plugin object by identifier.
   *
   * @param string $processor_id
   *   Identifier of processor plugin.
   *
   * @return \Drupal\bibcite\CitationStylerInterface
   *   The called Styler object.
   */
  public function setProcessorById($processor_id);

  /**
   * Get current processor plugin.
   *
   * @return \Drupal\bibcite\Plugin\BibCiteProcessorInterface|null
   *   Current processor plugin.
   */
  public function getProcessor();

  /**
   * Get all available processors plugins.
   *
   * @return array
   *   List of available processor plugins.
   */
  public function getAvailableProcessors();

  /**
   * Get current CSL style.
   *
   * @return \Drupal\bibcite\Entity\CslStyleInterface|null
   *   Current CSL style.
   */
  public function getStyle();

  /**
   * Set CSL style.
   *
   * @param \Drupal\bibcite\Entity\CslStyleInterface|null $csl_style
   *   CSL style object or NULL to reset to default style.
   *
   * @return $this
   *
   * @todo Use nullable type hint when Drupal will drop PHP 7.0 support.
   */
  public function setStyle($csl_style);

  /**
   * Load and set style by identifier.
   *
   * @param string $style_id
   *   CSL style identifier.
   *
   * @return \Drupal\bibcite\CitationStylerInterface
   *   The called Styler object.
   */
  public function setStyleById($style_id);

  /**
   * Get list of available bibliographic styles.
   *
   * @return array
   *   Bibliographic styles list.
   */
  public function getAvailableStyles();

  /**
   * Get current used language code.
   *
   * @return string
   *   Current language code.
   */
  public function getLanguageCode();

  /**
   * Set language code.
   *
   * @param string $lang_code
   *   Language code.
   *
   * @return \Drupal\bibcite\CitationStylerInterface
   *   The called Styler object.
   */
  public function setLanguageCode($lang_code);

}

Members

Namesort descending Modifiers Type Description Overrides
CitationStylerInterface::getAvailableProcessors public function Get all available processors plugins. 1
CitationStylerInterface::getAvailableStyles public function Get list of available bibliographic styles. 1
CitationStylerInterface::getLanguageCode public function Get current used language code. 1
CitationStylerInterface::getProcessor public function Get current processor plugin. 1
CitationStylerInterface::getStyle public function Get current CSL style. 1
CitationStylerInterface::render public function Render CSL data to bibliographic citation. 1
CitationStylerInterface::setLanguageCode public function Set language code. 1
CitationStylerInterface::setProcessor public function Set processor plugin. 1
CitationStylerInterface::setProcessorById public function Load plugin object by identifier. 1
CitationStylerInterface::setStyle public function Set CSL style. 1
CitationStylerInterface::setStyleById public function Load and set style by identifier. 1