I'm writing a custom module that's going to need to retrieve channel data using a direct database query.
One of the custom fields is an Assets image and I need to get the full image URL and alt_text in the most efficient way possible.
Is there a "best practice" way to get all this data out of Assets when armed with an entry ID and custom field ID? In pseudo-code I'd quite like to do this:
$assets = new Assets;
$file = $assets->getFileData($entry_id,$field_id);
$url = $file->url;
$alt_text = $file->alt_text;
Alternatively I could JOIN the necessary tables in my query but it looks like there would be quite a few.