Function __global->already_rated

Definitions

sources/feedback.php

  • Find whether you have rated the specified resource before.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$rating_for_types array No No required parameter N/A N/A List of feedback types (downloads, etc) that this rating is for. All need to be rated for it to return true.
$content_id ID_TEXT No No required parameter N/A N/A The ID of the type that this rating is for
&$previous_ratings ?array Yes No Null N/A N/A A map (type to rating) of previous ratings by the user (null: not set yet); returned by reference

Returns

  • Whether the resource has already been rated
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find whether you have rated the specified resource before.
 *
 * @param  array $rating_for_types List of feedback types (downloads, etc) that this rating is for. All need to be rated for it to return true.
 * @param  ID_TEXT $content_id The ID of the type that this rating is for
 * @param  ?array $previous_ratings A map (type to rating) of previous ratings by the user (null: not set yet); returned by reference
 * @return boolean Whether the resource has already been rated
 */

function already_rated(array $rating_for_types, string $content_id, ?array &$previous_ratings = null) : bool