/** * Gets the class name by type string and module loation * @param string $type The (simplified) type string * @param ModuleLocation $location The location; either Backend or Frontend * @return string Returns the class name associated with the type string * @throws \InvalidArgumentException Raises exception if type has incorrect format */ static function ModuleClass($type, ModuleLocation $location) { $parts = \explode(self::$bundleModuleSeparator, $type); if (count($parts) != 2) { throw new \InvalidArgumentException('Module type string must be in the format <bundle>-<module>'); } $bundle = $parts[0]; $module = $parts[1]; $folderLocation = $location->Value(); return self::BundleNamespace($bundle) . "\\Modules\\{$folderLocation}\\{$module}"; }