function votingapi_get_user_votes in Voting API 5
A simple helper function that returns all votes cast by a given user for a piece of content.
Parameters
$content_type: A string identifying the type of content whose votes are being retrieved. Node, comment, aggregator item, etc.
$content_id: The key ID of the content whose votes are being retrieved.
$uid: The integer uid of the user whose votes should be retrieved.
Return value
An array of matching votingapi_vote records.
1 call to votingapi_get_user_votes()
- votingapi_unset_vote in ./
votingapi.module - Deletes all votes cast on a particular content-object by a user. In most cases, this is the function that should be used by external modules.
File
- ./
votingapi.module, line 306
Code
function votingapi_get_user_votes($content_type, $content_id, $uid = NULL) {
if ($uid == NULL) {
global $user;
$uid = $user->uid;
}
return _votingapi_get_raw_votes($content_type, $content_id, NULL, NULL, $uid);
}