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;
}