Selecting type of files for listing

Hi. Although I am trying to hack the mod "Custom Index" a bit for my own special purpose, perhaps it is still better for me to post it here, as it is a general coding question.


I would like to display only PDF files uploaded in my Custom Index page (see box with title "Latest sheet music uploads"). Is there a line of code that can help me do that? Upon guesswork study, this seems to be the line that produces the list (from  .../mod/custom_index.php):


//grab the latest files
 $files = elgg_list_entities(array('type' => 'object', 'subtype' => 'file', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => FALSE));

  • that *is the code that fetches the files' listing;
    but you'll need more than "one of code"" to filter by mimetype
    because the mimetype is stored much further away than type, subtype are - 
    as metadata and that api call above is not hitting the metadata at all.
    and so have to do the files fetching in some other manner, 
    unless the file upload code is changed to store the mimetype say as subtype.