Back to PhocaGalleryRateCategory class

Method checkUserVote

public static
checkUserVote
(mixed $catid, mixed $userid)

Method checkUserVote - Source code

public static function checkUserVote($catid, $userid)
{
    $db = Factory::getDBO();
    $query = 'SELECT v.id AS id' . ' FROM #__phocagallery_votes AS v' . ' WHERE v.catid = ' . (int) $catid . ' AND v.userid = ' . (int) $userid . ' ORDER BY v.id';
    $db->setQuery($query, 0, 1);
    $checkUserVote = $db->loadObject();
    if ($checkUserVote) {
        return true;
    }
    return false;
}