You are here

interface FlagMappingInterface in Flags 8

Interface for flag mapping service to map different values to flag codes.

Interface FlagMappingInterface

Hierarchy

Expanded class hierarchy of FlagMappingInterface

All classes that implement FlagMappingInterface

2 files declare their use of FlagMappingInterface
flags.module in ./flags.module
flags_language.module in flags_language/flags_language.module

File

src/Mapping/FlagMappingInterface.php, line 11

Namespace

Drupal\flags\Mapping
View source
interface FlagMappingInterface {

  /**
   * Maps provided string to a flag code.
   * Returned string should be lower case flag code.
   *
   * @param string $value   Value of the source data.
   *
   * @return string
   */
  public function map($value);

  /**
   * Gets array with attributes for each option element.
   *
   * @param array $options
   *   The array of keys, either language codes, or country codes.
   *
   * @return \Drupal\Core\Template\Attribute[]
   *   List of classes per option.
   */
  public function getOptionAttributes(array $options = []);

  /**
   * Returns array of extra classes for specific mapper.
   *
   * @return string[]
   */
  public function getExtraClasses();

}

Members

Namesort descending Modifiers Type Description Overrides
FlagMappingInterface::getExtraClasses public function Returns array of extra classes for specific mapper. 1
FlagMappingInterface::getOptionAttributes public function Gets array with attributes for each option element. 1
FlagMappingInterface::map public function Maps provided string to a flag code. Returned string should be lower case flag code. 1