public function getAllElements ($elementType)
    {
        $iterator = new \DirectoryIterator($this->getUserSubDirectory("{$elementType}s"));
        $allElements = [];

        /** @var \SplFileInfo $file */
        foreach ($iterator as $file)
        {
            if ($file->isDir() || ("twig" !== $file->getExtension()))
            {
                continue;
            }

            $reference = "@{$elementType}/{$file->getBasename()}";
            $element = new Element($reference);
            $allElements[$element->getKey()] = $element;
        }

        return $allElements;
    }
public function getAllElements ($elementType)
    {
        $iterator = new \DirectoryIterator($this->getUserSubDirectory("{$elementType}s"));
        $allElements = [];

        /** @var \SplFileInfo $file */
        foreach ($iterator as $file)
        {
            if ($file->isDir() || ("twig" !== $file->getExtension()))
            {
                continue;
            }

            $reference = "@{$elementType}/{$file->getBasename()}";
            $element = new Element($reference);
            $allElements[$element->getKey()] = $element;
        }

        return $allElements;
    }
public function getAllElements ( $ elementType ) { $ iterator = new \ DirectoryIterator ( $ this -> getUserSubDirectory ( "{$elementType}s" ) ) ; $ allElements = [ ] ; /** @var \SplFileInfo $file */ foreach ( $ iterator as $ file ) { if ( $ file -> isDir ( ) || ( "twig" !== $ file -> getExtension ( ) ) ) { continue ; } $ reference = "@{$elementType}/{$file->getBasename()}" ; $ element = new Element ( $ reference ) ; $ allElements [ $ element -> getKey ( ) ] = $ element ; } return $ allElements ; }
Returns a list of all elements

@param string $elementType

@return Element[]
Returns a list of all elements