Neos\Flow\Package\PackageManager::getFilteredPackages PHP 메소드

getFilteredPackages() 공개 메소드

Returns an array of PackageInterface objects of all packages that match the given package state, path, and type filters. All three filters must match, if given.
public getFilteredPackages ( string $packageState = 'available', string $packagePath = null, string $packageType = null ) : array
$packageState string defaults to available
$packagePath string
$packageType string
리턴 array
    public function getFilteredPackages($packageState = 'available', $packagePath = null, $packageType = null)
    {
        switch (strtolower($packageState)) {
            case 'available':
                $packages = $this->getAvailablePackages();
                break;
            case 'active':
                $packages = $this->getActivePackages();
                break;
            case 'frozen':
                $packages = $this->getFrozenPackages();
                break;
            default:
                throw new Exception\InvalidPackageStateException('The package state "' . $packageState . '" is invalid', 1372458274);
        }
        if ($packagePath !== null) {
            $packages = $this->filterPackagesByPath($packages, $packagePath);
        }
        if ($packageType !== null) {
            $packages = $this->filterPackagesByType($packages, $packageType);
        }
        return $packages;
    }