Mercurial > hg > isophonics-drupal-site
comparison core/modules/rdf/src/SchemaOrgDataConverter.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\rdf; | |
4 | |
5 class SchemaOrgDataConverter { | |
6 | |
7 /** | |
8 * Converts an interaction count to a string with the interaction type. | |
9 * | |
10 * Schema.org defines a number of different interaction types. | |
11 * | |
12 * @param int $count | |
13 * The interaction count. | |
14 * @param array $arguments | |
15 * An array of arguments defined in the mapping. | |
16 * Expected keys are: | |
17 * - interaction_type: The string to use for the type of interaction | |
18 * (e.g. UserComments). | |
19 * | |
20 * @return string | |
21 * The formatted string. | |
22 * | |
23 * @see http://schema.org/UserInteraction | |
24 */ | |
25 public static function interactionCount($count, $arguments) { | |
26 $interaction_type = $arguments['interaction_type']; | |
27 return "$interaction_type:$count"; | |
28 } | |
29 | |
30 } |