protected function filterItemList(&$itemList, $filter)
    {
        if (!$filter)
            return;

        $result = [];
        foreach ($itemList as $item) {
            if ($item->getFileType() == $filter) {
                $result[] = $item;
            }
        }

        $itemList = $result;
    }
protected function filterItemList(&$itemList, $filter)
    {
        if (!$filter)
            return;

        $result = [];
        foreach ($itemList as $item) {
            if ($item->getFileType() == $filter) {
                $result[] = $item;
            }
        }

        $itemList = $result;
    }
protected function filterItemList ( & $ itemList , $ filter ) { if ( ! $ filter ) return ; $ result = [ ] ; foreach ( $ itemList as $ item ) { if ( $ item -> getFileType ( ) == $ filter ) { $ result [ ] = $ item ; } } $ itemList = $ result ; }
Filters item list by file type.
@param array $itemList Specifies the item list to sort.
@param string $filter Determines the document type filtering preference.
Supported values are 'image', 'video', 'audio', 'document' (see FILE_TYPE_XXX constants of MediaLibraryItem class).
Filters item list by file type .