concrete/src/File/FolderItemList.php
public function filterByExtension($extension)
    {
        $extensions = is_array($extension) ? $extension : [$extension];
        if (count($extensions) > 0) {
            $expr = $this->query->expr();
            $or = $expr->orX();
            foreach ($extensions as $extension) {
                $extension = ltrim((string) $extension, '.');
                $or->add($expr->eq('fv.fvExtension', $this->query->createNamedParameter($extension)));
                if ($extension === '') {
                    $or->add($expr->isNull('fv.fvExtension'));
                }
            }
            $this->query->andWhere($or);
        }
    }
public function filterByExtension($extension)
    {
        $extensions = is_array($extension) ? $extension : [$extension];
        if (count($extensions) > 0) {
            $expr = $this->query->expr();
            $or = $expr->orX();
            foreach ($extensions as $extension) {
                $extension = ltrim((string) $extension, '.');
                $or->add($expr->eq('fv.fvExtension', $this->query->createNamedParameter($extension)));
                if ($extension === '') {
                    $or->add($expr->isNull('fv.fvExtension'));
                }
            }
            $this->query->andWhere($or);
        }
    }
public function filterByExtension ( $ extension ) { $ extensions = is_array ( $ extension ) ? $ extension : [ $ extension ] ; if ( count ( $ extensions ) > 0 ) { $ expr = $ this -> query -> expr ( ) ; $ or = $ expr -> orX ( ) ; foreach ( $ extensions as $ extension ) { $ extension = ltrim ( ( string ) $ extension , '.' ) ; $ or -> add ( $ expr -> eq ( 'fv.fvExtension' , $ this -> query -> createNamedParameter ( $ extension ) ) ) ; if ( $ extension === '' ) { $ or -> add ( $ expr -> isNull ( 'fv.fvExtension' ) ) ; } } $ this -> query -> andWhere ( $ or ) ; } }
Filter the files by their extension.

@param string|string[] $extension one or more file extensions (with or without leading dot)
Filter the files by their extension .