Back to PhocacartDownload class

Method hit

protected static
hit
(mixed $id)

Method hit - Source code

protected static function hit($id)
{
    $db = Factory::getDBO();
    $query = $db->getQuery(true)->update('#__phocacart_order_downloads')->set($db->quoteName('download_hits') . ' = (' . $db->quoteName('download_hits') . ' + 1)')->where('id = ' . $db->quote((int) $id));
    $db->setQuery($query);
    $db->execute();
    return true;
}