annotate core/modules/rdf/src/SchemaOrgDataConverter.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\rdf;
Chris@0 4
Chris@0 5 class SchemaOrgDataConverter {
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Converts an interaction count to a string with the interaction type.
Chris@0 9 *
Chris@0 10 * Schema.org defines a number of different interaction types.
Chris@0 11 *
Chris@0 12 * @param int $count
Chris@0 13 * The interaction count.
Chris@0 14 * @param array $arguments
Chris@0 15 * An array of arguments defined in the mapping.
Chris@0 16 * Expected keys are:
Chris@0 17 * - interaction_type: The string to use for the type of interaction
Chris@0 18 * (e.g. UserComments).
Chris@0 19 *
Chris@0 20 * @return string
Chris@0 21 * The formatted string.
Chris@0 22 *
Chris@0 23 * @see http://schema.org/UserInteraction
Chris@0 24 */
Chris@0 25 public static function interactionCount($count, $arguments) {
Chris@0 26 $interaction_type = $arguments['interaction_type'];
Chris@0 27 return "$interaction_type:$count";
Chris@0 28 }
Chris@0 29
Chris@0 30 }