Sulu\Component\Content\Metadata\Factory\StructureMetadataFactory::getStructureNames PHP Method

getStructureNames() private method

Return the structure names for the given type (not necessarily valid).
private getStructureNames ( string $type ) : string[]
$type string
return string[]
    private function getStructureNames($type)
    {
        $this->assertExists($type);
        $structureNames = [];
        foreach ($this->typePaths[$type] as $pathConfig) {
            $structurePath = $pathConfig['path'];
            // Ignore not-existing paths
            if (!file_exists($structurePath)) {
                continue;
            }
            $iterator = new \DirectoryIterator($structurePath);
            foreach ($iterator as $file) {
                $ext = $file->getExtension();
                if ($ext !== 'xml') {
                    continue;
                }
                $structureNames[] = $file->getBasename('.' . $ext);
            }
        }
        return $structureNames;
    }