Back to PhocaGalleryImageFront class

Method setFileNameByImageId

public static
setFileNameByImageId
(mixed $id = 0)

Method setFileNameByImageId - Source code

public static function setFileNameByImageId($id = 0)
{
    $f = '';
    if ((int) $id > 0) {
        $db = Factory::getDBO();
        $query = ' SELECT a.filename, a.extid, a.exts, a.extm, a.extw, a.exth' . ' FROM #__phocagallery AS a' . ' WHERE a.id = ' . (int) $id . ' ORDER BY a.id' . ' LIMIT 1';
        $db->setQuery($query);
        $f = $db->loadObject();
    }
    return $f;
}