Back to PhocaGalleryCommentCategory class

Method checkUserComment

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

Method checkUserComment - Source code

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