Puli\Manager\Api\Module\ModuleList::get PHP Метод

get() публичный Метод

Returns the module with the given name.
public get ( string $name ) : Puli\Manager\Api\Module\Module
$name string The module name.
Результат Puli\Manager\Api\Module\Module The module with the passed name.
    public function get($name)
    {
        if (!isset($this->modules[$name])) {
            throw new NoSuchModuleException(sprintf('The module "%s" was not found.', $name));
        }
        return $this->modules[$name];
    }

Usage Example

Пример #1
0
 private function makeAbsolute($relativePath, Module $containingModule, ModuleList $modules)
 {
     // Reference to install path of other module
     if ('@' !== $relativePath[0] || false === ($pos = strpos($relativePath, ':'))) {
         return $containingModule->getInstallPath() . '/' . $relativePath;
     }
     $refModuleName = substr($relativePath, 1, $pos - 1);
     if (!$modules->contains($refModuleName)) {
         throw new NoSuchModuleException(sprintf('The module "%s" referenced in the resource path "%s" was not ' . 'found. Maybe the module is not installed?', $refModuleName, $relativePath));
     }
     $refModule = $modules->get($refModuleName);
     return $refModule->getInstallPath() . '/' . substr($relativePath, $pos + 1);
 }
All Usage Examples Of Puli\Manager\Api\Module\ModuleList::get