data__sequence_checksum_formatter.inc

File

tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum_formatter.inc
View source
  1. <?php
  2. class data__sequence_checksum_formatter extends ChadoFieldFormatter {
  3. // The default lable for this field.
  4. public static $default_label = 'Sequence checksum';
  5. // The list of field types for which this formatter is appropriate.
  6. public static $field_types = array('data__sequence_checksum');
  7. /**
  8. * @see TripalFieldFormatter::view()
  9. */
  10. public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
  11. foreach ($items as $delta => $item) {
  12. $content = key_exists('value', $item) ? $item['value'] : '';
  13. $element[$delta] = array(
  14. // We create a render array to produce the desired markup,
  15. '#type' => 'markup',
  16. '#markup' => $content,
  17. );
  18. }
  19. }
  20. }