Example #1
0
 public static function normalizeName($key)
 {
     return StringUtils::slugify($key, '_');
 }
Example #2
0
 public static function conceptPathSegment(DOMElement $element)
 {
     // Path segment is named according to the first english term, and
     // default to the first term.
     $terms = self::filter($element->childNodes, array(Navigator::class, 'isTerm'));
     $term = self::find($terms, array('self', 'isPathLang'));
     if (!$term) {
         if (isset($terms[0])) {
             $term = $terms[0];
         } else {
             throw new ThesaurusException(sprintf('No term linked to concept at path "%s".', $element->getNodePath()));
         }
     }
     return StringUtils::slugify($term->getAttribute(self::TERM_VALUE_ATTR));
 }