public static function Vote::getCurrentIp in Voting API 8.3
Default value callback for 'vote_source' base field definition.
Return value
string The IP address hash from the user who submitted the vote.
See also
::baseFieldDefinitions()
File
- src/
Entity/ Vote.php, line 256
Class
- Vote
- Defines the Vote entity.
Namespace
Drupal\votingapi\EntityCode
public static function getCurrentIp() {
return hash('sha256', serialize(\Drupal::request()
->getClientIp()));
}