SchemaOrgDataConverter.php 760 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\rdf;
  3. class SchemaOrgDataConverter {
  4. /**
  5. * Converts an interaction count to a string with the interaction type.
  6. *
  7. * Schema.org defines a number of different interaction types.
  8. *
  9. * @param int $count
  10. * The interaction count.
  11. * @param array $arguments
  12. * An array of arguments defined in the mapping.
  13. * Expected keys are:
  14. * - interaction_type: The string to use for the type of interaction
  15. * (e.g. UserComments).
  16. *
  17. * @return string
  18. * The formatted string.
  19. *
  20. * @see http://schema.org/UserInteraction
  21. */
  22. public static function interactionCount($count, $arguments) {
  23. $interaction_type = $arguments['interaction_type'];
  24. return "$interaction_type:$count";
  25. }
  26. }