You are here

public static function H5PValidatorImport::libraryToString in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/H5PImportClasses/H5PValidatorImport.php \Drupal\opigno_module\H5PImportClasses\H5PValidatorImport::libraryToString()

Writes library data as string {machineName} {majorVersion}.{minorVersion}.

Parameters

array $library: With keys machineName, majorVersion and minorVersion.

bool $folderName: Use hyphen instead of space in returned string.

Return value

string On the form {machineName} {majorVersion}.{minorVersion}

File

src/H5PImportClasses/H5PValidatorImport.php, line 94

Class

H5PValidatorImport
This class is used for validating H5P files.

Namespace

Drupal\opigno_module\H5PImportClasses

Code

public static function libraryToString(array $library, $folderName = FALSE) {
  return (isset($library['machineName']) ? $library['machineName'] : $library['name']) . ($folderName ? '-' : ' ') . $library['majorVersion'] . '.' . $library['minorVersion'];
}